I will explain different DAX formulas, one will work better than the others depending on what I need to do. For that, let’s take this data as example:
To see the result, first I will create a measure by clicking on “home -> new measure” and put the formula. Secondly, I will create a “card” in the visualization and in the “fields”, I put the “measure”.
If I do a simple total of the first column, I get this result:
Now I want to show it as percentage, the easy way is:
ROUND(SUM('table'[argument]),2)&"%"
But as you can see, there is no the plus sign since the percentage is positive, to remediate it:
FORMAT(SUM('table'[argument])/100,"+0.00%;-0.00%")
Now, let’s do something else, I want the percentage between 2022 and 2021, my formula will be like this:
ROUND((CALCULATE(SUM('table'[argument1]),'table'[argument2]="xxx")/
CALCULATE(SUM('table'[argument1]),'table'[argument2]="xxx"))*100,2)&"%"
So to show the positive or negative sign, I can use the “format” option:
FORMAT((CALCULATE(SUM('table'[argument1]),'table'[argument2]="xxx")/
CALCULATE(SUM('table'[argument1]),'table'[argument2]="xxx")),"+0.00%;-0.00%")
Or I can use this option by defining a variable:
var npsign = ROUND((CALCULATE(SUM('table'[argument1]),'table'[argument2]="xxx")/
CALCULATE(SUM('table'[argument1]),'table'[argument2]="xxx"))*100,2)
RETURN IF(npsign>0,"+"&npsign&"%",npsign&"%")
Just to show the negative sign in case of negative percentage:
When you are managing a team, “how to be a good manager” is the “must”...
As manager, I am doing many reports, even when I was an ITIL consultant, I still needed to do many reports...
ITIL V3 is going to be obsolete...
Managing an IT service when I start a new company is not an easy task, particularly true, if the service...