Forum Discussion
Creating a new table with measures in rows
- 4 years ago
Hi SajjadMousavi
You can start with creating a crossjoin table between Measure Names and the values of Year-Month column of the date table. Something like
Filter Table =
CROSSJOIN ( VALUES ( 'Date'[YearMonth] ), { "Measure 1", "Measure 2", "Measure 3" } )
Then create a relationship between the Year-Month columns in the two tables (many to many). The values column that contains the names of the measures can then be used in the table visual without generating error message about the relationship.Next is simple. Create one measure wich contains switch statement. Something like
Measure =VAR SelectedMeasure = SELECTEDVALUE ( 'Filter Table'[Value] )
RETURN
SWITCH (
TRUE ( ),
SelectedMeasure = "Measure 1", [Measure 1],
SelectedMeasure = "Measure 2", [Measure 2],SelectedMeasure = "Measure 3", [Measure 3]
)
Hi SajjadMousavi
You can start with creating a crossjoin table between Measure Names and the values of Year-Month column of the date table. Something like
Filter Table =
CROSSJOIN ( VALUES ( 'Date'[YearMonth] ), { "Measure 1", "Measure 2", "Measure 3" } )
Then create a relationship between the Year-Month columns in the two tables (many to many). The values column that contains the names of the measures can then be used in the table visual without generating error message about the relationship.
Next is simple. Create one measure wich contains switch statement. Something like
Measure =
VAR SelectedMeasure = SELECTEDVALUE ( 'Filter Table'[Value] )
RETURN
SWITCH (
TRUE ( ),
SelectedMeasure = "Measure 1", [Measure 1],
SelectedMeasure = "Measure 2", [Measure 2],
SelectedMeasure = "Measure 3", [Measure 3]
)
Thanks a lot for your solution. It worked flawlessly! It just needed a small correction in my case (and I don't know why!):