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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
pandakillsalot
Helper II
Helper II

How to make the measurement change with the slicer?

Hi all,

 

I am trying to calculate a rate, which should be equals to (pass number) / (serial number) if before 2018 and should be equal to constant one after 2018. My report also uses data as a slicer to show different pass rate for different months.

 

I realize that in my implementation since the date is an arbitrary value when I choose my slicer, it will only result  in one kind of one calculation way instead of counting both of them. For example. if the date is 2018/1/1, it will give me all "1", even for the 2017/1/1.

 

Any thoughts to deal with it?

 

 

 

1 ACCEPTED SOLUTION
v-juanli-msft
Community Support
Community Support

Hi pandakillsalot,

It needs to display value1 before 1/1/2018, and value2 after 1/1/2018, is it?

If so, This measure could help

Measure 2 =
IF (
    MAX ( StressProduction[Date] ) < DATE ( 2018, 1, 1 ),
    MAX ( [NumberPassesCorrect] ) / MAX ( [Unique SN count] ),
    DIVIDE ( 1, 1, 0 )
)

15.jpg

16.jpg

If you have any question, feel free to ask me.

Best regards

Maggie

View solution in original post

3 REPLIES 3
v-juanli-msft
Community Support
Community Support

Hi pandakillsalot,

It needs to display value1 before 1/1/2018, and value2 after 1/1/2018, is it?

If so, This measure could help

Measure 2 =
IF (
    MAX ( StressProduction[Date] ) < DATE ( 2018, 1, 1 ),
    MAX ( [NumberPassesCorrect] ) / MAX ( [Unique SN count] ),
    DIVIDE ( 1, 1, 0 )
)

15.jpg

16.jpg

If you have any question, feel free to ask me.

Best regards

Maggie

Thank you so much, it worked. I didn't even know that I should compare data in data() function. Thank you so much.

pandakillsalot
Helper II
Helper II

question_1.PNG

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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