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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
datanau001
Helper III
Helper III

Measure for KPI indicator

Dear all,

 

I'm trying to create a KPI indicator with below dax code:

 

KPI Indicator Measure =
IF (
SUM( 'V_SR_STATUS_LINES_SEC'[Total Audit Time Hrs] ) < SUM( 'V_SR_STATUS_LINES_SEC'[AMT SLA] ),
"KPI Met",
"KPI Not Met"
)
 
However, it is not returning the expected result (see below image):
- on the left we have the columns to be compared "Time and SLA" and on the right when I put the measure "KPI Indicator Measure" it modifies the table where the time is then empty and everything is coming as "KPI not met".
Measure.jpg
 
I also tried it as a calculated column, but it won't work because in some SR numbers, I can have more than on line with different times and then it will create duplicates with both KPI Met and KPI not met, which would result in a wrong count of SR's.
 
So, I'd like to request your support on how I can fix this.
 
Thank you!
Datanaut
 
 
 
2 REPLIES 2
Greg_Deckler
Community Champion
Community Champion

@datanau001 Try this:

KPI Indicator Measure =
  SWITCH(TRUE(),
    SUM('V_SR_STATUS_LINES_SEC'[Total Audit Time Hrs]) = BLANK(),BLANK(),
    SUM( 'V_SR_STATUS_LINES_SEC'[Total Audit Time Hrs] ) < SUM( 'V_SR_STATUS_LINES_SEC'[AMT SLA] ),"KPI Met",
    "KPI Not Met"
)


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!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

@Greg_Deckler Hello Greg, thank you for your answer.

 

It worked partially. See below, now in some cases the comparisson is not correct. 

In first two lines, it should be KPI Not met

 

measure_2.jpg

 

Regards

Marcelo

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.