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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
MichaelHutchens
Helper IV
Helper IV

DAX 'COUNTA' measure that ignores slicers

Hi team, I'm hoping someone can help.

I have a DAX measure below that I'm using in a line graph to track how many conversations take place in an online forum over time. There is one conversation per row:

COUNT_TOTAL_MESSAGES = COUNTA(Email[Subject])


I have a slicer next to this line graph that I use to filter the line graph by the types of conversations, to see trends over time. But I'd like to add another line or column to this visualisation that shows total conversations over time, to give viewers a sense of what proportion the filtered conversations are of total conversations, for additional context.

This extra line needs to ignore the slicer, but the code below doesn't work:

UNFILTERED_COUNT_TOTAL_MESSAGES = CALCULATE(COUNTA(Email[Subject]), ALL(Email[Subject]))


Any idea what I'm doing wrong?

4 REPLIES 4
MichaelHutchens
Helper IV
Helper IV

Hi @Corey_M , thank you that worked 🙂 Your response has made me realise that what I actually need is a way to ignore the slicer, but also group conversations based on date. Otherwise, the DAX measure is giving me a total count of all conversations over all time, but displaying them in my line graph each month. Here's an example of how it looks now - the blue line is the modified DAX measure, and the date field is in the red box:

 

2023-11-23_06-13-06.png

What do you think?

on further thought the crux of the issue is that the all on the measure clears the context of the filter that your x-axis (date heirarchy) provides, but you want it to ignore a slicer that operates also on your date heirarchy.  you might have more luck using your original measure but editing the interactions such that your slicer does not interact with your visual.

do you have a table for months and years? I have implemented something similar before. I just had to add something like this to the filter. 

Format('Email'[Date],"yyyy-MM") = Format(('DateTable'[Date]), "yyyy-MM")



 

Corey_M
Resolver II
Resolver II

is there a reason you aren't using ALL(Email) instead, I suspect the issue is that the ALL is clearing any filters on the Subject Column, but not whatever Time column your slicer acts on

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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