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
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.
Hi, thanks for your answer
But I have an error with "MeasureType[Type]"
- v-jingzhang5 years agoCommunity Support
Hi Anonymous
In my model, "MeasureType" is a table which contains a column named "Type". In the column "Type", it contains values "LV" and "RV". You can download the sample pbix in my previous post to see the details.
You can use Enter Data to create a table similar to "MeasureType" easily. Then create measures similar to mine. Note that in your measures, you need to use your table and column names rather than just copying my table and column names, otherwise you will have an error like "cannot find table.../column..."
Regards,
Jing
- Anonymous5 years agoNot applicable
Hi v-jingzhang
In my case it's in the Stat table however it's not a column but a measure like you can see on the screen
So "Measure Type" corresponds to "Stat" in my case but "Type" I don't know...Thanks for you help !- v-jingzhang5 years agoCommunity Support
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