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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Anonymous
Not applicable

Applying filter on the basis of two Dimension tables in fact table with logical OR condition

Hi Experts, 

 

I have a requirement where i have to filter the reports on the basis of two dimensions with OR condition. The table descriptions are in the attached image and the filter to apply in the report is Dim_Table_1.year>=2014 or Dim_Table_2.Year>=2015.    

 

Table Design.JPG

2 REPLIES 2
v-yuta-msft
Community Support
Community Support

Hi anandtiwari,

 

Based on your description, you want to use [YEAR] columns in two Dim tables to filter the Fact_table, right?

You can create a measure in Fact table using DAX below:

Measure = CALCULATE(aggregation, FILTER(Fact_Table, RELATED(Dim_Table_1[YEAR]) >= 2014 || RELATED(Dim_Table_2[YEAR]) >= 2015))

 

Regards,

Jimmy Tao

Anonymous
Not applicable

Thank you for this suggestion Jimmy, Now the requirement is User needs to enter the Year value as parameters. It is like : 

 

Param_1 = 2014, Param_2 =2015

 

Measure = CALCULATE(aggregation, FILTER(Fact_Table, RELATED(Dim_Table_1[YEAR]) >= Param1 || RELATED(Dim_Table_2[YEAR]) >= Param2)) 

 

Will you guide if the same works in Power BI,If yes how we can achieve this. I am using Direct query to connect to Data Source. 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.