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, get a free DP-600 exam voucher to use by the end of 2024. Register 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
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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