4 Replies Latest reply on Aug 16, 2016 10:52 AM by Luciano Vasconcelos

# Distinct Count Calculated Field

Dear Forum,

I am trying to find a tableau equivalent of the following Excel formula:" =COUNTIF(A:A,[@Building])" to calculate total number of units per building. Any help would be much appreciated!

BuildingUnitTotal Units
1A3
1B3
1C3
2A2
2B2
3A1
4A1
• ###### 1. Re: Distinct Count Calculated Field

hi Tiffany,

If you want to populate the table as you have here (so have the 3 for building A repeated for all 3 rows) then FIXED LoD is probably the way to go.

FIXED LoDs have some similarity to SUMIFS/COUNTIFS...in Excel (although many differences too!)

So in your example it would be

{FIXED [Building]: COUNTD([Unit])}

Let me know if that doesn't do the trick, or if that doesn't make sense.

1 of 1 people found this helpful
• ###### 2. Re: Distinct Count Calculated Field

See this one.

1 of 1 people found this helpful
• ###### 3. Re: Distinct Count Calculated Field

Many thanks to Luciano and Simon! I was confused about the calculation showing up as "undefined" in the data panel, but it worked!

• ###### 4. Re: Distinct Count Calculated Field

Simon's answer is correct.