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

Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now

Reply
sflynn
Helper I
Helper I

DAX Measure Category Total per row

I am trying to display the total count by category for each line item within the category based on the slicer selections. The problem I am having is if I use a count ignoring the field used in the slicer it takes the total regardless of the slicer selection. Conversly, if I use a count without ignoring the slicer fields the totals show based on the different fields in the slicer and now the total for the category.
In the example below the total count for the category "Tropical Costa Rica" is 9, which is what I want to diplay for each date under that category. Each date has a status associated to it and there are 3 statu's selected in the slicer. The line items totals are showing the total number of dates based on the status associated to the date. If all status' were selected there are a total of 12 dates, so if I was to use a count ignoring the status filter each date would show as 12 rather than 9. Is there any way I could write a forumla to the total count for the category under each line item based on the slicer selection?

Current forumla: Calculate(Countrows('Data'),Allexcept('Data','Data'[Name],'Data'[Month]))Example.png

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@sflynn , Not very clear, Try a measure like

Calculate(Countrows('Data'),filter(allselected('Data'),'Data'[Name] = max('Data'[Name]) && 'Data'[Month] =max('Data'[Month])))

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

View solution in original post

5 REPLIES 5
sflynn
Helper I
Helper I

Please see the following link to the pbx file with example data: https://1drv.ms/u/s!ApuQfyu6Yovsak-ZgMJmN3VH79s?e=oCnr1u 

Ashish_Mathur
Super User
Super User

Hi,

Share the link from where i can download your PBI file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
amitchandak
Super User
Super User

@sflynn , Not very clear, Try a measure like

Calculate(Countrows('Data'),filter(allselected('Data'),'Data'[Name] = max('Data'[Name]) && 'Data'[Month] =max('Data'[Month])))

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

That worked! Thank you for help, very much appreciated.

Helpful resources

Announcements
OCT PBI Update Carousel

Power BI Monthly Update - October 2024

Check out the October 2024 Power BI update to learn about new features.

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

October NL Carousel

Fabric Community Update - October 2024

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