Forum Discussion
Creating a Measure To Return Summarized Values Based on Report Parameters/Slicers
Sorry...errant click. Will continue...
The measure to calculate Severity is as follows...
Severity =
VAR DelayCount = [Delay Count]
VAR DelayDuration = [Total Delay (Hours)]
RETURN
SWITCH(
TRUE(),
AND(
DelayCount > 'Delay Count'[Delay Count Value],
DelayDuration > 'Delay Duration'[Delay Duration Value]
),
"Catastrophic",
AND(
DelayCount > 'Delay Count'[Delay Count Value],
DelayDuration > 'Delay Duration'[Delay Duration Value]
),
"Severe",
"Normal"
)
For this to work correctly, you need to have two "what if" parameters for Delay Duration and Delay Count in your data model. You can find those under Modeling on the Ribbon. In short, those create the ability for your users to determine at what levels something is catastrophic or not.
One thing I just noticed is that the measure compares delay count/duration to the appropriate parameter for both "catastrophic" and "severe" otherwise it will return normal. The way I defined catastrophic and severe are identical so if it meets the definition, it will never return severe (because it always returns the first true condition). You should figure out how to want to modify the definitions to differentiate between the two. But otherwise I think this is giving you exactly what you described.