Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
I have a chart where the user can select both metric and dimension in slicers, e.g there are metrics for appointments and DNA %. These metrics are displayed dynamically based on a DAX measure which selects whichever one is selected in the slicer.
The dimension, (e.g. age group, ethnicity etc) is selected in another slicer which is populated by a calculation group, with an expression like this for each dimension:
CALCULATE( SELECTEDMEASURE(), USERELATIONSHIP(DimensionIndex[UniqueID], DIM_Ethnicity[UniqueID]) )
The chart looks like this and works beautifully where all the values are whole numbers, but I have a metric that is a percentage which needs to be formatted as a %:
I have tried formatting the value in the source measure and in my DAX measure that selects the metric, but this breaks the chart, and instead of showing the selected dimension in the legend it shows all the values for every dimension:
Any ideas as to how to format individual metrics in this situation?
Thanks
Leslie
Solved! Go to Solution.
Well, as often happens, I worked this out myself soon after posting this, and with a bit of help from this video: Dynamic NUMBER FORMATTING using CALCULATION GROUPS in Power BI - YouTube
To fix this I added a format column to my metrics table (values are 0 for number metrics and #0.0% for percentages). Then I created a new calculation group with just one item called format, which has the expression SELECTEDMEASURE() and the format string expression is SELECTEDVALUE(Metrics[Format]).
Finally I added a filter to the chart, which is the 'name' field from the calculation group and selected the column in it.
Well, as often happens, I worked this out myself soon after posting this, and with a bit of help from this video: Dynamic NUMBER FORMATTING using CALCULATION GROUPS in Power BI - YouTube
To fix this I added a format column to my metrics table (values are 0 for number metrics and #0.0% for percentages). Then I created a new calculation group with just one item called format, which has the expression SELECTEDMEASURE() and the format string expression is SELECTEDVALUE(Metrics[Format]).
Finally I added a filter to the chart, which is the 'name' field from the calculation group and selected the column in it.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
7 | |
2 | |
2 | |
2 | |
1 |
User | Count |
---|---|
6 | |
5 | |
4 | |
3 | |
2 |