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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Ben81
Helper I
Helper I

Matrix table filter by inactive relationship

Hi, Hoping for some help on this issue...

I have a matrix table with a date field in the rows and then a text description and account number in the value sections and these fields are from my main data table.

I then have a slicer with week commencing from my date dimension table and I want to be able to select a week and filter the matrix table to show me all records within that selected week. 

 

The issue I have is that the date used in the matrix table is not the active relationship so when I select the week it won't filter correctly. I guess I have to create a measure and use the function USERRELATIONSHIP but not sure how to write the DAX because it's not really a calculation in the table but rather just values that I want to filter down based on the date. 

 

Any ideas how I solve this?

 

Thanks

Ben

1 ACCEPTED SOLUTION
Icey
Community Support
Community Support

Hi @Ben81 ,

 

You can create a measure like so:

Measure = IF ( MAX('FactTable'[Date]) IN VALUES('DateDim'[Date]),1)

 

And then, you can use it as the "Filters on this visual" and set it as "is 1".

 

If this not work, you can put the measure into your Matrix visual and then turn off word wrap in the matrix setting and drag the field of the measure to hide it.

 

 

Best Regards,

Icey

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
Icey
Community Support
Community Support

Hi @Ben81 ,

 

You can create a measure like so:

Measure = IF ( MAX('FactTable'[Date]) IN VALUES('DateDim'[Date]),1)

 

And then, you can use it as the "Filters on this visual" and set it as "is 1".

 

If this not work, you can put the measure into your Matrix visual and then turn off word wrap in the matrix setting and drag the field of the measure to hide it.

 

 

Best Regards,

Icey

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Juliet1
Frequent Visitor

Hello Icey

I tried your solution for a similar issue I am currently facing, but unfortunately, it doesn't disable the active relationship. As a result, it seems like two filters are being applied simultaneously. Do you have any ideas on how I can resolve this?

 

Thanks!

Whitewater100
Solution Sage
Solution Sage

Hi:

You can just make another copy of your date table and connect to the inactive date in your fact table. If your Date Table is names "Dates" then

New Table 

Dates II = Dates
You can have plenty of date tables to play role dimensions.
amitchandak
Super User
Super User

@Ben81 , Example

calculate( SUM(Sales[Sales Amount]),USERELATIONSHIP ('Table'2[CreateDate], 'Date'[Date])

 

https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-tr...

https://radacad.com/userelationship-or-role-playing-dimension-dealing-with-inactive-relationships-in...

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hi,

Not sure how this helps me? It's not a calculation I'm trying to perform. I just have a table with a list of dates and text values that I want to filter based on a inactive relationship. 

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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