Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hello,
I'm trying to creat a dynamic chart(Stacked Bar Chart) which can display a metric in both number and percentage formats..
I tried creating a switch measure with appropriate formulae but the problem is it is showing both in same decimal format.
Please help me in getting the actual result.
Solved! Go to Solution.
Hi @kkalyanrr,
It is not supported to make a measure to dynamically return different data types for result. As you can in below screenshot, using FORMAT function to format result converts the data type to Text which resulted in the blank chart.
Best regards,
Yuliana Gu
Relative newbie to Power BI but is there a solution to this problem. I am currently using a measure, see below, to return either a percentage or a whole number to a set of line and bar charts, depending on a slicer selection.
When I add the FORMAT function my charts vanish.
If it has been resolved can you give me a link to the answer. If not is there any word as to when it may be resolved?
Hi @kkalyanrr,
It is not supported to make a measure to dynamically return different data types for result. As you can in below screenshot, using FORMAT function to format result converts the data type to Text which resulted in the blank chart.
Best regards,
Yuliana Gu
@kkalyanrr try two things
1) Check these properties
Visualizations -> Format tab- > Go to Field Formatting-> There is a parameter 'Value decimal places
OR
2) Create follwing measure or column using Format Fixed (replace with your columns)
Swith = SWITCH(TRUE(),Report[Column]=1,FORMAT([Measure],"Fixed"),Report[Column]=2,FORMAT([Measure2],"Fixed"))
I've tried both the options but couldnt get the exact result..
The result I was looking for, when I use "Number" in slicer selection the chartr shld display number values(like 12,14) and "Percentage" in slicer selection the chart should display Percentage values(like 20%,30%)
Thanks..
@kkalyanrr I am able to switch measure and format it using following formula
Swith = SWITCH(TRUE(),Report[Column]="Number",FORMAT([Number],0),Report[Column]="Percentage",FORMAT([Percentage],"Percent")
@itsmebvk
Its working fine for Card chart but not with the Bar Charts..Please see the attached screenshot.
@kkalyanrr Apparently I am also observing same issue, I had gone through few threads, they also facing same issue, seems to be limitations in PBI as far as my understanding.
User | Count |
---|---|
140 | |
113 | |
104 | |
77 | |
63 |
User | Count |
---|---|
135 | |
126 | |
110 | |
70 | |
61 |