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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
wem
Frequent Visitor

Sum of count

Hi,

Below a simplified view of the model I use for my calculations.

I've made a measure (count) of FileNumber. In that table the complaint_ID and FileNumber are unique.

Count FileNumber generates: 1000 unique FileNumbers

 

In order to count FileNumbers on Department (Table 2) and on Subject (Table 3) I made following dax:

Calculate ( measureFileNumber, crossfilter ( Table1[complaint_ID], Table2[complaint_ID], 2), crossfilter ( Table2[cyclus_ID], Table3[Cyclus_ID],2 ) ) 

So far so good because it 'works': it's returning  a unique measureFileNumber on level of Department and Subject.

 

But in reality one FileNumber can affect more then one Department or more then one Subject.

example:

FileNumber 2018-800 relates to 2 department and relates to 2 Subjects.

2018-800 / Department 1 / Subject 1

2018-800 / Department 2 / Subject 1

2018-800 / Department 2 / Subject 2

 

In this case, the MeasureFileNumber should return 3 instead of 1 when displayed in a Card-visual

I've been trying with sumx (solution I found on the community), combined with the different sorts of 'counts' but without the expected result.

 

Can someone please assist me in finding the correct dax formula?

Thanks in advance.

Complaints.png

1 ACCEPTED SOLUTION
mahoneypat
Microsoft Employee
Microsoft Employee

Please try a measure like this one

 

Subject Count = COUNTROWS(SUMMARIZE(Table3, Table3[Subject], Table2[Complaint_ID], Table2[Department]))

 

Regards,

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


View solution in original post

2 REPLIES 2
mahoneypat
Microsoft Employee
Microsoft Employee

Please try a measure like this one

 

Subject Count = COUNTROWS(SUMMARIZE(Table3, Table3[Subject], Table2[Complaint_ID], Table2[Department]))

 

Regards,

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Hi Pat, 

This solution works excellent! Thanks a lot.

Wim

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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