Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Format matrix measure based on slicer selection

Hello fellow Power BI developers,

Im working with a star schema sales report containing a fact sales table and related information tables. I have a solution to my problem, but i am wondering if there's an alternative maybe more efficient solution to such a problem.

Lets say i have this kind of slicer filter:
 

And my matrix looks more or less like this:
(Slicer value selected is Growth YoY abs)

If i go to Growth YoY% i want to keep the conditional formatting of data bars and produce a percentage value:

The problem is since FORMAT function returns a string data bars stop working and the Total won't sort my data.
My measure looks like this:

Is there a way to control the format of a produced value so its returned in percentage or a number format (int, double, decimal etc.). ?