Hi all,
I have created a switch measure (refer below) that when put in a slicer allows the user to switch between different measures being shown in a clustered column chart. I've then created a dynamic format expression (the April 2023 update) for the measure so that depending on the measure chosen in the slicer the formatting will change to match.
The Switch Measure to filter in the slicer is:
MeasuresTable_AllMeasures =
SWITCH(
[MeasuresTable_SelectedMeasure],
1, [COUNTPayments_Total], <-- needs to be formatted in Thousands (e.g. 612856789 would show as 613K)
2, [%COUNTPayments], <-- needs to be formatted to in percentage to zero decimal places (62.5% would format as 63%)
3, 'Measures Table'[SUMPayments_Total], <-- needs to be formatted in Millions (e.g. 1625789 would format as $2M)
4, 'Measures Table'[%SUMPayments] <-- needs to be formatted to in percentage to zero decimal places (62.5% would format as 63%)
)
The Switch Measure Dynamic Format Expression is:
VAR __SelectedMeasure = SELECTEDVALUE(Measures_Selection[Code],1)
RETURN
SWITCH(
TRUE(),
__SelectedMeasure = 1, "0,.K",
__SelectedMeasure = 2, "0%",
__SelectedMeasure = 3, "$#,.M",
__SelectedMeasure = 4, "0%"
)
The Problem
The formatting is working as required when the 'Measures Table'[%SUMPayments] & [%COUNTPayments] measures are chosen in the slicer, however when the [COUNTPayments_Total] or 'Measures Table'[SUMPayments_Total] is chosen, the data labels on the clustered column chart appear as the full value instead of the shortened format in the expression (e.g. 13206 will appear as 13206K) but when i hover over the bar and look at the value of the bar there, it appears in the correct shortened format (e.g. 13206 appears as 13K). I have my data label value field appearing with 'None" for display units and "0" decimal places when it appears like this. If i then change the decimal places to "1" the data label changes to one decimal place as expected, appearing as 13.2K for example. If i change the visual from any of the column visuals to a matrix or table, the values appear with no decimal points, as expected. Can you please advise why this is occuring and how i could display with no decimal points?
The tooltip value and value field.

Thank you.