Forum Discussion
Create table from measures
- Anonymous8 years ago
HI abukapsoun,
For your scenario, you can try to use 'union' and 'row' functions.Sample:
Table = UNION(ROW("Name","Measure1","Value",[Measure1]),ROW("Name","Measure2","Value",[Measure2]),ROW("Name","Measure3","Value",[Measure3]))Notice:
1. Above formula not suitable to create a dynamic table. if you measure values are based filter/slicer, it will show the blank as the value.
2. I haven't test on complex measures who contains specific filters and other conditions, so I'm not so sure if they can works on this formula.
3. I also test with DATATABLE function, but it seem not support dynamic value and alert me to use static value.
Regards,
Xiaoxin Sheng
Hi parr4 ,
Not sure what you would want to show in the third column. If you mean add a third value then use this measure. I commented out the if statement and added SWITCH() function.
This measure shows the values for the second column.
Value table =
VAR _curValue1 = 'Value 1'[Value 1 Value]
VAR _curTableValue =
MAX ( NewTable[Value] )
VAR _curValue2 = 'Value 2'[Value 2 Value]
VAR _curValue3 = 'Value 3'[Value 3 Value]
RETURN
//IF ( _curTableValue = "Value 1", _curValue1, _curValue2 )
SWITCH (
_curTableValue,
"Value 1", _curValue1,
"Value 2", _curValue2,
"Value 3", _curValue3
)
If you wanted to show a third column, that perhaps squares the values in the second column...
Square the value in column 2 =
VAR _curValue1 = 'Value 1'[Value 1 Value]
VAR _curTableValue =
MAX ( NewTable[Value] )
VAR _curValue2 = 'Value 2'[Value 2 Value]
VAR _curValue3 = 'Value 3'[Value 3 Value]
RETURN
//IF ( _curTableValue = "Value 1", _curValue1, _curValue2 )
SWITCH (
_curTableValue,
"Value 1", _curValue1 * _curValue1,
"Value 2", _curValue2 * _curValue2,
"Value 3", _curValue3 *_curValue3
)
The first column was entered using Entered Data. The next two columns each had their own measure.
Let me know if you have any questions.
If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos πare nice too.
Nathaniel
This seems like what I'm looking for but cannot determine the format of "newtable" in -
VAR _curTableValue =
MAX ( newtable[Value] )
And the link to you pbix doesn't seem to be working, though I know this is an older post. Could you help clarify where this is coming from in the hypothetical?