Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hello PBI community,
I would like to create a custom KPI card that will show the difference in number + percentage difference for the current month vs. the previous one.
For example, clicking on February, the difference in the custom KPI card should be
4.32 = 100%
3.21 = 74.3 %
200 - 74.3 % = 25.7%
Custom KPI card for February
- 1.11
- 25.7 %
Thank you so much !
Solved! Go to Solution.
Hi , @TornDigorn
According to your descriptin, you want to custom the KPI card , and you want to show the differnce and the percentage in KPI card.
After my test, KPI displays Value and Goal by default, and there is no Difference:
So for your need , you can follow this to create a custom KPI card:
Custom KPI card in Power BI - Data Bear - Power BI Training
And i can give your the dax code to get the differnce and the percentage:
Difference = var _date = MAX('Table'[Date])
var _t = FILTER( ALL('Table'), YEAR('Table'[Date]) = YEAR(_date) && MONTH('Table'[Date])=MONTH(_date)-1)
return
CALCULATE( AVERAGE('Table'[Final Days]) , YEAR('Table'[Date]) = YEAR(_date) , MONTH('Table'[Date])=MONTH(_date)) - AVERAGEX(_t,[Final Days])
Percentage = var _date = MAX('Table'[Date])
var _t = FILTER( ALL('Table'), YEAR('Table'[Date]) = YEAR(_date) && MONTH('Table'[Date])=MONTH(_date)-1)
return
DIVIDE(CALCULATE( AVERAGE('Table'[Final Days]) , YEAR('Table'[Date]) = YEAR(_date) , MONTH('Table'[Date])=MONTH(_date)) - AVERAGEX(_t,[Final Days]) ,AVERAGEX(_t,[Final Days]))
The result is as follows:
Thank you for your time and sharing, and thank you for your support and understanding of PowerBI!
Best Regards,
Aniya Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi , @TornDigorn
According to your descriptin, you want to custom the KPI card , and you want to show the differnce and the percentage in KPI card.
After my test, KPI displays Value and Goal by default, and there is no Difference:
So for your need , you can follow this to create a custom KPI card:
Custom KPI card in Power BI - Data Bear - Power BI Training
And i can give your the dax code to get the differnce and the percentage:
Difference = var _date = MAX('Table'[Date])
var _t = FILTER( ALL('Table'), YEAR('Table'[Date]) = YEAR(_date) && MONTH('Table'[Date])=MONTH(_date)-1)
return
CALCULATE( AVERAGE('Table'[Final Days]) , YEAR('Table'[Date]) = YEAR(_date) , MONTH('Table'[Date])=MONTH(_date)) - AVERAGEX(_t,[Final Days])
Percentage = var _date = MAX('Table'[Date])
var _t = FILTER( ALL('Table'), YEAR('Table'[Date]) = YEAR(_date) && MONTH('Table'[Date])=MONTH(_date)-1)
return
DIVIDE(CALCULATE( AVERAGE('Table'[Final Days]) , YEAR('Table'[Date]) = YEAR(_date) , MONTH('Table'[Date])=MONTH(_date)) - AVERAGEX(_t,[Final Days]) ,AVERAGEX(_t,[Final Days]))
The result is as follows:
Thank you for your time and sharing, and thank you for your support and understanding of PowerBI!
Best Regards,
Aniya Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
107 | |
97 | |
75 | |
63 | |
62 |
User | Count |
---|---|
142 | |
104 | |
104 | |
80 | |
66 |