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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

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
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 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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

Top Solution Authors