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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
BI_Newbie2
Regular Visitor

Help! Measure Not Working Correctly

Hi all,

I'm fairly new to BI and I am trying to create a column that I can use as a Conditional Formatting Icon column.  It's fairly simple, or at least I thought it was, I'm trying to create a measure in my Fact table to apply a "Good or Bad" scale to identify if the current state is in "Good" shape or "Bad" shape, if the actual value is within 5 pts of the forecasted value it's still considered "Good"

VAR HealthInd = SELECTEDVALUE(DIM_KPI[HealthInd]) VAR Actual = SELECTEDVALUE('FACT'[Actual]) VAR Up = SELECTEDVALUE('FACT'[Upper]) VAR Low = SELECTEDVALUE('FACT'[Lower]) RETURN IF(HealthInd= "High" && Actual > Up || HealthInd = "Low" && Actual < Low, "Bad", "Good")
However when I add the new measure to my table, I keep getting results that are multiplied several times and not even accurately.  I need to be able to filter by month and have 1 row for each KPI but it just won't work and I'm not sure what I'm doing wrong.
 
Note:  this is the first time trying to share a file, so I'm hoping this link will work! 
2 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

@BI_Newbie2 , Try measure with this modification

 

Health Status =
VAR HealthInd = MAX(DIM_KPI[HealthInd])
VAR Actual = MAX('FACT'[Actual])
VAR Up = MAX('FACT'[Upper])
VAR Low = MAX('FACT'[Lower])
RETURN
IF(
HealthInd = "High" && Actual > Up ||
HealthInd = "Low" && Actual < Low,
"Bad",
"Good"
)

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

View solution in original post

v-linhuizh-msft
Community Support
Community Support

Thanks for the reply from amitchandak.

 

Hi @BI_Newbie2 ,

 

Is your aim at this stage to get the result that HealthInd is neutral with the “Good” status, if I understand you correctly, I rewrote your arithmetic logic:

 

NewHealthStatus =
VAR _act =
    SUM ( 'FACT'[Actual] )
VAR _up =
    SUM ( 'FACT'[Upper] )
VAR _down =
    SUM ( 'FACT'[Lower] )
VAR _health =
    MAX ( 'DIM_KPI'[HealthInd] )
RETURN
    IF (
        _act >= _down
            && _act <= _up
            && NOT _health IN { "Low", "High" },
        "Good",
        "Bad"
    )

 

The result is as follows:

 

vlinhuizhmsft_0-1724393547346.png

 

 

Best Regards,
Zhu
Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

View solution in original post

2 REPLIES 2
v-linhuizh-msft
Community Support
Community Support

Thanks for the reply from amitchandak.

 

Hi @BI_Newbie2 ,

 

Is your aim at this stage to get the result that HealthInd is neutral with the “Good” status, if I understand you correctly, I rewrote your arithmetic logic:

 

NewHealthStatus =
VAR _act =
    SUM ( 'FACT'[Actual] )
VAR _up =
    SUM ( 'FACT'[Upper] )
VAR _down =
    SUM ( 'FACT'[Lower] )
VAR _health =
    MAX ( 'DIM_KPI'[HealthInd] )
RETURN
    IF (
        _act >= _down
            && _act <= _up
            && NOT _health IN { "Low", "High" },
        "Good",
        "Bad"
    )

 

The result is as follows:

 

vlinhuizhmsft_0-1724393547346.png

 

 

Best Regards,
Zhu
Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

amitchandak
Super User
Super User

@BI_Newbie2 , Try measure with this modification

 

Health Status =
VAR HealthInd = MAX(DIM_KPI[HealthInd])
VAR Actual = MAX('FACT'[Actual])
VAR Up = MAX('FACT'[Upper])
VAR Low = MAX('FACT'[Lower])
RETURN
IF(
HealthInd = "High" && Actual > Up ||
HealthInd = "Low" && Actual < Low,
"Bad",
"Good"
)

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.