Forum Discussion
Anonymous
7 years agoNot applicable
switch between two y-axis columns
Hello, so I have a line graph. on the y-axis is a set of data set by a spesific unit. I would like to be able to switch from the current unit of data to a diffrent unit of data, is there a way to cha...
dedelman_clng
Community Champion
7 years agoHere is how I have done it previously:
I create a table "Unit Type" with one column "Type" and 2 values:
Volume
Energy
I then create a measure on that table
MType = SELECTEDVALUE('Unit Type'[Type])'Unit Type'[Type] will populate your slicer.
On the fact table, I create a measure that switches between calculations based on the value selected in the slicer
Total Volume =
SWITCH (
[MType],
"Energy", CALCULATE (
SUM ( FG[Volume] ),
UoM[Unit of Measure] = "MMBTU"
),
"Volume", CALCULATE (
SUM ( FG[Volume] ),
UoM[Unit of Measure] = "MSCF"
)
)SWITCH() is a multi-part IF statement. See this link SWITCH() for more information.
If you're still having trouble, see this link to give the community all of the necessary information:
https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
David
Anonymous
7 years agoNot applicable