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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
Anonymous
Not applicable

How to set measures to function only when a filter (slicer) is selected?

Hi all,

 

I want to be able to set a measure to only occur when I select a slicer filter. This is the dashboard I have at the moment (I have blocked irrelevant data out). 

 

KyleAdam_0-1629808074984.png

I have a measure that's currently not being used that totals the PO's and takes it away from the invoices and gets a profit. As you can see above the PO billed should be 3,000 but it's not because I turned it off. The reason why I turned it off is because when I unselect the Deals filter, it will duplicate the total PO's because I have so many different PO fields that I'm working with. 

It's very complicated and I don't need to go into details. However, all I want to know is, how could I set a measure that when a current deal is selected, it is then implemented? And when no Deal is selected that measure is no longer used? Here is the measure I want to use when a Deal is selected. 

VO PO Total = [VO1 PO Total] + [VO2 PO Total]

It's just an easy measure that's adding up two other measures which is simply counting rows and getting a figure. How would I make this measure only operate a Deal is selected? Any help would be appreciated, thank you. 





 

1 ACCEPTED SOLUTION
Greg_Deckler
Super User
Super User

@Anonymous Perhaps use ISFILTERED. ISFILTERED function (DAX) - DAX | Microsoft Docs

 

IF(ISFILTERED('Table'[Column]),[Measure],BLANK())


Follow on LinkedIn
@ 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!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

2 REPLIES 2
Greg_Deckler
Super User
Super User

@Anonymous Perhaps use ISFILTERED. ISFILTERED function (DAX) - DAX | Microsoft Docs

 

IF(ISFILTERED('Table'[Column]),[Measure],BLANK())


Follow on LinkedIn
@ 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!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

Hi thank you @Greg_Deckler 

If you're free though, can you also show me how to do an OR statement in this function, so if a Deal isn't selected it will just use the default value? Because at the moment I've just noticed it's affecting all the figures when a Deal isn't selected, so it's all blank. 

Helpful resources

Announcements
July 2024 Power BI Update

Power BI Monthly Update - July 2024

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

Top Solution Authors