Forum Discussion
Create a measures table
- 5 years ago
Hi Anonymous
I create a sample file for your reference.
Create measures:
Average = SWITCH(SELECTEDVALUE(MeasureType[Type]),"LV",[Average LV Flow],"RV",[Average RV Flow]) SD = SWITCH(SELECTEDVALUE(MeasureType[Type]),"LV",[SD LV Flow],"RV",[SD RV Flow]) ......Regards,
Community Support Team _ Jing
If this post helps, please Accept it as the solution to help other members find it. - 5 years ago
Hi Anonymous
Actually it doesn't matter which table the measures are located in. They always work the same. The thing you need to do is to create a new table like below. You can use Enter data to enter RV and LV values in a column. You can name the column header as you like.
Then create measures like below. The purpose of this measure is to decide when the type is LV, then return the result of [ ... LV ... ] measure otherwise return [... RV ...] measure's result.
Average = SWITCH(SELECTEDVALUE(MeasureType[Type]),"LV",[Average LV Flow],"RV",[Average RV Flow])Jing
You'll need to create a new table with a column that has values "RV" and "LV" in it. Add that to a Matrix visual in 'Columns'. Let's call that table Metric and the column V
Then you can add measures to the Values of the Matrix and set the Format property of Values to 'show on rows' to On (it's off in this screenshot):
For the measures to add, follow a pattern such as this:
Average =
SWITCH( SELECTEDVALUE(Metric[V])
, "RV", [Average RV Flow]
, "LV", [Average LV Flow]
)
SD =
SWITCH( SELECTEDVALUE(Metric[V])
, "RV", [SD RV Flow]
, "LV", [SD LV Flow]
)
etc...
Thanks for your answer
I have created my new table with RV and LV columns wich are empty
But I failed to insert my measures(from an another table named "STAT") into this table
- AllisonKennedy5 years agoCommunity Champion
Anonymous as v-jingzhang stated it won't matter which table your measures are in. Use the formula I provided or he provided:
Average = SWITCH(SELECTEDVALUE(FlowTable[Type]),"LV",[Average LV Flow],"RV",[Average RV Flow]) SD = SWITCH(SELECTEDVALUE(FlowTable[Type]),"LV",[SD LV Flow],"RV",[SD RV Flow])You have two columns for each type, but only need one column for Type and then use that in a matrix to turn it into columns.