Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
I've have a clustered column chart and the following measure:
that allows me to switch between a dollar view and percentage view with a slicer at the top of the page. However, whenever I try and format these, the graph doesn't show anything.
Hi @Anonymous ,
Here we can create two measures instead of a combined one to work around and format the two measures in the Modeling pane. One for percentage format and one for currency format.
doll = var sel = SELECTEDVALUE('Table'[Value]) var _sum = CALCULATE(SUM('Table'[Value]),ALL('Table')) return IF(sel=2,_sum,BLANK())
percent = var _min = CALCULATE(MIN('Table'[Value]),ALL('Table')) var _max = CALCULATE(MAX('Table'[Value]),ALL('Table')) var sel = SELECTEDVALUE('Table'[Value]) return IF(sel=1,_min/_max,BLANK())
In your scenario, I thin you should create two measure like this.
RevenueCash_Pct Switcher1 = if([Selection3]=1,[Revenue],BLANK())
RevenueCash_Pct Switcher2 = IF (Selection3]=2,[Revenue_Cash],BLANK())
Also please find the pbix as attached.
Regards,
Frank
Hi @Anonymous ,
Does that make sense? If so, kindly mark my answer as the solution to close the case please. Thanks in advance.
Regards,
Frank
The FORMAT function turns the value into text, so the chart cannot interpret the text in this case.
However, you can change the way the logic works.
You can first prepare 2 series to be used, one for the dollar value and another for the percentage, e.g.
A) myValue = if([Selection3] = 1,0,myTable[ValueToBeUsed]) then set the format from Modeling tab to currency > USD
B) myValue% = if([Selection3]=1,myTable[ValueToBeUsed],0) and keep it unformatted
In the chart series add series A as it is, and add series B as a percent from grand total
When you make a selection to Selection3, the logic of each measure will either show the value or return 0, so only one series will be shown.
You can adjust the percent format from modeling tab to set how many decimal points you want
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
111 | |
100 | |
80 | |
64 | |
58 |
User | Count |
---|---|
148 | |
111 | |
93 | |
84 | |
66 |