Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and a 50 percent discount on exams.
Get startedEarn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
I am doing a dashboard showing percentage score of each month for different elements. I am stuck at adding a comparision/different from this month to the previous month. For example, August's overall is 45% and July's overall is 40% and I want to show the 5% different in the Card or Bar Chart Visualization. Also, is it possible to make an up or down arrow to indicate that instead of the minus sign?
Solved! Go to Solution.
This is because Month column data type is not a date.
You can try to change the Month column data type to Date in transform data option.
Right click on the table particular table in Data section > go to edit query
Select the month column
Go to Transform tab in the top menu.
change Data Type to “Date"
Once change it, Click on File > Close and Apply
After that try to create the measure.
You can use below query to indicate negative values with down arrow key, positive value with up arrow key
Overall Score Diffrence =
VAR _CurrentMonthScore =
SUM ( 'Table'[Score] )
VAR _PrevMonthScore =
CALCULATE ( SUM ( 'Table'[Score] ), PREVIOUSMONTH ( 'Table'[Month] ) )
VAR Diff = _CurrentMonthScore - _PrevMonthScore
RETURN
IF (
Diff < 0,
CONCATENATE ( UNICHAR ( 9660 ), FORMAT ( ABS ( Diff ), "Percent" ) ),
CONCATENATE ( UNICHAR ( 9650 ), FORMAT ( Diff, "Percent" ) )
)
Additionally, You can use conditional formatting for values like below to show negative values with another color ( ▼ )
You can try below measure to calculate the diffrence between months.
Overall Score Diffrence =
VAR _CurrentMonthScore = SUM('Table'[Score])
VAR _PrevMonthScore =
CALCULATE(SUM('Table'[Score]),PREVIOUSMONTH('Table'[Month]))
RETURN
_CurrentMonthScore - _PrevMonthScore
It gave me this error.
This is because Month column data type is not a date.
You can try to change the Month column data type to Date in transform data option.
Right click on the table particular table in Data section > go to edit query
Select the month column
Go to Transform tab in the top menu.
change Data Type to “Date"
Once change it, Click on File > Close and Apply
After that try to create the measure.
Thank you for the formula!