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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
KH_Mike
Helper III
Helper III

Handle negative number to show the performance correctly

Hi All,

 

I have a set of financial data which contain negative number. I make to measure to sum the "This Year Result" and "Last Year Result". Right now, I would like to create new measure "My IDeas" to show the performance accordingly. However, some negative number make me confuse and not sure how to write the DAX. Any people have experience to handle this situation?

 

LYRTMRChangeChange %My Ideas
-100-8020-20%Improve
-100-120-2020%Not Improve
-10090190-190%Improve
100-90-190-190%Not Improve
1001202020%Improve
120100-20-17%Not Improve
4 REPLIES 4
Greg_Deckler
Super User
Super User

@KH_Mike Maybe:

My Ideas =
  SWITCH(TRUE(),
    [Change]>0,"Improve",
    [Change]<0,"Not Improve",
    "Unchanged"
  )


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!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

Hi @Greg_Deckler ,

 

Thank you. If I want to include one more criteria (e.g.: Change More / Less than 10%) how to amend the DAX? Because for the first row or recrod, if I just calculate the change in %, then it will become negative change. In reality, that is really a improvement. Thank you.

 

 

@KH_Mike When checking the % use ABS for absolute value? Or when caculating the change use ABS for LYR like:

[Change] / ABS([LYR]) 

 

Probably ought to do that anyway.



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!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

Hi @Greg_Deckler ,

 

Seems the logic should be use the absolute value for % and positive change then "Improve". If negative change then "Not Improve". Thank you.

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!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

Feb2025 NL Carousel

Fabric Community Update - February 2025

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