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

Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now

Reply
ziyab
Frequent Visitor

Selecting a value from a slicer of Dimension table but filtering the data using another value

Hi,

I have a dimension table named AccountingPeriod and a fact table named FinancialFact.

Active Relationship: AccountingPeriod.id 1-* FinancialFact.AccountingPeriodid

Now when I select 30th June 2024 from the slicer, I need to see previous period values of 31st March 2024 i.e. 30 & 40. I have tried creating inactive relationship between AccountingPeriod.PreviousPeriod Ending and FinancialFact.periodend and using USERELATIONSHIP but that has not worked.

Please provide guidance on how to achieve the desired result. Thanks!

ziyab_0-1708602330194.png

 

1 ACCEPTED SOLUTION
v-jingzhan-msft
Community Support
Community Support

Hi @ziyab 

 

You need to remove the current relationship between two tables. Otherwise if you need this relationship in other visuals and calculations, you have to create a new period table that has the id and ending date column, and keep this new table disconnected from the fact table. Use this disconnected table's ending date column in the slicer. 

 

Then create the following measure. Use this measure on the table visual as a filter field and set it to show items when value is 1. This will get what you want. 

Measure = IF(SELECTEDVALUE('FinancialFact Table'[id])=MAX('Ending Date Table'[id])-1, 1, 0)

vjingzhanmsft_0-1708654894240.png

 

Best Regards,
Jing
If this post helps, please Accept it as Solution to help other members find it. Appreciate your Kudos!

View solution in original post

1 REPLY 1
v-jingzhan-msft
Community Support
Community Support

Hi @ziyab 

 

You need to remove the current relationship between two tables. Otherwise if you need this relationship in other visuals and calculations, you have to create a new period table that has the id and ending date column, and keep this new table disconnected from the fact table. Use this disconnected table's ending date column in the slicer. 

 

Then create the following measure. Use this measure on the table visual as a filter field and set it to show items when value is 1. This will get what you want. 

Measure = IF(SELECTEDVALUE('FinancialFact Table'[id])=MAX('Ending Date Table'[id])-1, 1, 0)

vjingzhanmsft_0-1708654894240.png

 

Best Regards,
Jing
If this post helps, please Accept it as Solution to help other members find it. Appreciate your Kudos!

Helpful resources

Announcements
OCT PBI Update Carousel

Power BI Monthly Update - October 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

October NL Carousel

Fabric Community Update - October 2024

Find out what's new and trending in the Fabric Community.