Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
th3h0bb5
Resolver II
Resolver II

Cross role-playing dim filtering

Here is my model (simplified to make this clearer):

 

Model.png

 

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:

Selection.png

 

I want to create a filter which automatically reduces this rows where ProgramYear = Snapshot Year. Like so:

ProperSelection.png

 

My final goal is to create a Table visual that returns this:

 

FinalResult.png

 

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?

2 ACCEPTED SOLUTIONS
DataInsights
Super User
Super User

@th3h0bb5,

 

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]:

 

DataInsights_0-1657492985711.png

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

Ashish_Mathur
Super User
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.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

2 REPLIES 2
Ashish_Mathur
Super User
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.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
DataInsights
Super User
Super User

@th3h0bb5,

 

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]:

 

DataInsights_0-1657492985711.png

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

Check out the February 2024 Power BI update to learn about new features.

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.