Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

DAX Count and Include Zeros

I have only one table and cannot add dimensions. I'd like to count one field (ID) by another (State), but all include all possible States, regardless of later filters.

 

 

1 ACCEPTED SOLUTION

@Anonymous,

 

Add a calculated table and build relationship on [State] column, then add measure below.

 

Table =
DISTINCT ( Table1[State] )
Measure =
COUNT ( Table1[ID] ) + 0

 

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi

 

I think this is what you are looking for. Create a measure with this formulea:

 

Cnt = CALCULATE(COUNT(TABLE1[ID]), ALL(TABLE1[STATE]))

 

if not, please explain your requirement , some sample data will help.

 

Thanks

Raj

Anonymous
Not applicable

No, that's not what I need.

 

I can't attach files, but I'll show you a screenshot.

 

CountZeros.PNG

@Anonymous,

 

Add a calculated table and build relationship on [State] column, then add measure below.

 

Table =
DISTINCT ( Table1[State] )
Measure =
COUNT ( Table1[ID] ) + 0

 

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.