Forum Discussion
Cross role-playing dim filtering
Here is my model (simplified to make this clearer):
Both facts are forecasted values. So, something like "In 2017 (snapshot year) here's what we thought 2019's (program year) revenue would be. My business users get to pick one or more Program Years and I am trying to create a measure which will automatically filter the Snapshot Year to match the selected Program Years. Here's an example:
My business users wants to see Units Sold and Revenue for Program Year 2020 and 2021. These Program years were forecasted across several years, so his filter selection returns this:
I want to create a filter which automatically reduces this rows where ProgramYear = Snapshot Year. Like so:
My final goal is to create a Table visual that returns this:
What visual-level filter can I create which will automatically pass the two selected ProgramYears across to the SnapshotYear table and filter the fact tables accordingly?
Add this measure as a visual-level filter (filter "is 1"):
Year Match = IF ( MAX ( 'Program Year'[Year] ) = MAX ( 'Snapshot Year'[Year] ), 1 )The table visual uses Program Year[Year] and Snapshot Year[Year]:
Hi,
My approach would be as follows:
1. Append the 2 FACT tables
2. Unpivot all columns except the Program Year and Snapshot Year
3. Create a Calculcated column (Date) in the single FACT table (created in step 1 above)
4. Have only 1 calendar table with a relationship (Many to One and Single) from the Date column of the Fact table to the Date column of the Calendar Table
5. In the Calendar Table, write a calculated column formula to extract Year
6. To your visual, drag Year from the Calendar Table
7. Then write measures to get your desired result.
Hope this helps.
2 Replies
- Ashish_Mathur
Super User
Hi,
My approach would be as follows:
1. Append the 2 FACT tables
2. Unpivot all columns except the Program Year and Snapshot Year
3. Create a Calculcated column (Date) in the single FACT table (created in step 1 above)
4. Have only 1 calendar table with a relationship (Many to One and Single) from the Date column of the Fact table to the Date column of the Calendar Table
5. In the Calendar Table, write a calculated column formula to extract Year
6. To your visual, drag Year from the Calendar Table
7. Then write measures to get your desired result.
Hope this helps.
- DataInsights
Super User
Add this measure as a visual-level filter (filter "is 1"):
Year Match = IF ( MAX ( 'Program Year'[Year] ) = MAX ( 'Snapshot Year'[Year] ), 1 )The table visual uses Program Year[Year] and Snapshot Year[Year]: