Forum Discussion
kkalyanrr
Helper V
7 years agoCreating a dynamic chart(with formats Number and Percentage)
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 bu...
- 7 years ago
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
LyellDuggan
6 years agoNew Member
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?
MetricMeasure = IF(LEFT(SELECTEDVALUE('Metric'[Metric], "All"),6) = "Share ", [Total_Summary], IF(SELECTEDVALUE('Metric'[Metric],"All")="Expenditure", SUM([Expenditure]), IF(SELECTEDVALUE('Metric'[Metric],"All")="Products", SUM([NoProducts]), SUM([Value]))))