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
Anonymous
Not applicable

Use max value of slicer in dax formula

I have a collumn with the difference in minutes between a planned start time and a requested start time.

I have a 'less than or equal to' slicer with values from -100 to 100. 

Now i need to create a pie chart with the items that are late/not late, based on the max value of the slicer.

so for example: if the slicer selects the range -100 to 25, only the rows with a value with more than 25 are considered late. 

I created a Max value measure with the following formula that seems to work: 

max selected = CALCULATE(MAXA('Table (2)'[Column1]),ALLSELECTED('Table (2)'))
Now i made a calculated column to calculate if a row is late or not late given the 'max selected' value: 
L/NL = IF(OOS_Prodigis[Verschil planned/request]> 'Table (2)'[max selected],"L", "NL")
 
This however does not seem to work. The L/NL collumn still considers 100 as the max value, no matter where the slicer is positioned. 
Lore_1_0-1654606129869.png

 

Does anybody have any idea how to solve this? 

 

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , You can not use slicer value (measure ) in a calculated column .

 

Create a measure instead

maxx(OOS_Prodigis, IF(OOS_Prodigis[Verschil planned/request]> 'Table (2)'[max selected],"L", "NL"))

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Thank you, it worked. Now because I cant' add a measure as legend in my pie chart, I made 2 new measures to count the L / NL items of the measure you suggested and added those both as value to my pie chart. 

Thank you for your help! 

lore_11
Frequent Visitor

Thank you, it worked. Now because I cant' add a measure as legend in my pie chart, I made 2 new measures to count the L / NL items of the measure you suggested and added those both as value to my pie chart. 

Thank you for your help! 

amitchandak
Super User
Super User

@Anonymous , You can not use slicer value (measure ) in a calculated column .

 

Create a measure instead

maxx(OOS_Prodigis, IF(OOS_Prodigis[Verschil planned/request]> 'Table (2)'[max selected],"L", "NL"))

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.