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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Marcuskw
New Member

DAX Measure ignore filter/slicer selection

Hi,

 

I'm interested in creating a measure that doesn't change with Filter/Slicer settings to be included as a benchmark.

I've tried writing:

 

Revenue = CALCULATE(SUM(Table[Amount]);Table[Category]="Revenue";ALL(Table[City]))

 

However this still effects the measure when clicking on the filter

 

Br

Marcus

1 ACCEPTED SOLUTION

Hi @Marcuskw,

 


Is there a way to have the second table show all citys even if you clicked "Hamburg"? 

No. Since the slicer is related to table visual, it is not possible to still show all rows when you have selected an item in slicer. Unless you disable the interaction between slicer and visual, as mentioned by TomMartens.

 

To workaround your requirement, you could create an unrelated table which lists all available city names. That case, when you choose any value from slicer, the table visual won't be filtered by it. You said some other measures should still be affected by slicer selection, you could add filters into these measures. For example:

 

Selected city =
SELECTEDVALUE ( Table[Category] )



Measure =
CALCULATE (
    SUM ( Table[value] ),
    FILTER ( Table, Table[City] = [selected city] )
)

 

Regards,

Yuliana Gu

 
Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

7 REPLIES 7
TomMartens
Super User
Super User

Hey,

 

as you can see from this little screenshot

image.png

 

that the measure "All Revenue" is not affected by a slicer selection, here is the DAX for the measure:

All Revenue = 
CALCULATE(
    SUM(Table1[Amount])
    ,'Table1'[Category] = "Revenue"
    ,ALL('Table1'[City])
)

I'm wondering if there are more slicer / filter involved in your table that may affect the calculation.

 

Regards

Tom

 



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany
Anonymous
Not applicable

i am having meaures column in %

ID Value

A  10

b   20                                      so slicer should show two categories A 

c    30                                                                                                 B

d    40

e    50

f     60

 

if(value >30 ,value<50,"A","B")

But i am getting only one value in slicer ,how to achieve two values in slier

HI there,

 

Can you let me know how I would write the formula where, if instead of calculating the total Revenue, I wanted my measure to always be the total of only 1 city.

 

For example, If you have Hamburg selected as shown, but I want Toronto Revenue to be my "All Revenue" measure....my table on the right would show "Hamburg, Revenue, 100, 75"

 

Is this possible?

Hi TomMartens,

My aim is to have multiple measures in the same table where one interacts with the filter value and one doesn't.

I see that you edited the second table to not interact with the filter selection(Edit interactions and "None")

 

Is there a way to have the second table show all citys even if you clicked "Hamburg"?

 

Thanks

Marcus

 

No. Since the slicer is related to table visual, it is not possible to still show all rows when you have selected an item in slicer. Unless you disable the interaction between slicer and visual, as mentioned by TomMartens.

 

To workaround your requirement, you could create an unrelated table which lists all available city names. That case, when you choose any value from slicer, the table visual won't be filtered by it. You said some other measures should still be affected by slicer selection, you could add filters into these measures. For example:

 

Selected city =
SELECTEDVALUE ( Table[Category] )



Measure =
CALCULATE (
    SUM ( Table[value] ),
    FILTER ( Table, Table[City] = [selected city] )
)

 

Regards

rendani motlopi

Hi @Marcuskw,

 


Is there a way to have the second table show all citys even if you clicked "Hamburg"? 

No. Since the slicer is related to table visual, it is not possible to still show all rows when you have selected an item in slicer. Unless you disable the interaction between slicer and visual, as mentioned by TomMartens.

 

To workaround your requirement, you could create an unrelated table which lists all available city names. That case, when you choose any value from slicer, the table visual won't be filtered by it. You said some other measures should still be affected by slicer selection, you could add filters into these measures. For example:

 

Selected city =
SELECTEDVALUE ( Table[Category] )



Measure =
CALCULATE (
    SUM ( Table[value] ),
    FILTER ( Table, Table[City] = [selected city] )
)

 

Regards,

Yuliana Gu

 
Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Greg_Deckler
Super User
Super User

Is your filter based on City? Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Mastering Power BI 2nd Edition

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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