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.
Hello,
In the screenshot below I give my user the abolity to compare months either as an actual value or as a %. The problem is that I do not know how to force a percent format should my user select "As Percentage". In the (commented out) dax code below, I have tried to use the format() function but this breaks my entire visualisation.
Could anyone help me please?
Diff LM =
SWITCH( TRUE(),
[Selected Metric] = "By Amount", [Diff. to LM],
[Selected Metric] = "By Percent", [% Diff to LM],
// [Selected Metric] = "By Percent", format([% Diff to LM], "Percent"),
[Diff. to LM] )
When I try to format my percentage case, I loose all my values like so:
Hi @michellepace ,
You can have a look at this video.
https://www.youtube.com/watch?v=xV8x7OTXIkE
Regards,
Harsh Nathani
Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)
@michellepace
Your measure seems fine, can you try it on new table visual. Check your Slicer it it returns a single value as expected.
Diff LM =
SWITCH( TRUE(),
[Selected Metric] = "By Amount", [Diff. to LM],
[Selected Metric] = "By Percent", FORMAT([% Diff to LM], "Percent"),
[Diff. to LM]
)
________________________
Did I answer your question? Mark this post as a solution, this will help others!.
Click on the Thumbs-Up icon on the right if you like this reply 🙂
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
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 |
---|---|
10 | |
9 | |
7 | |
6 | |
5 |
User | Count |
---|---|
20 | |
11 | |
10 | |
9 | |
6 |