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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
ElvirBotic
Helper III
Helper III

Using date dim and filtering on different fact

Hello,

I have a modeling problem I cannot seem to find a good approach for. I have two fact tables. One is for inspections conducted and another is actions, which are derived from within an inspection. My current data model is as follows. Inspections filters Actions and is a 1:M relationship on audit_id. I also have a date_dim related to inspections on completed date. 

Here is what I am trying to solve. I want to be able to use my date_dim and filter a table of actions based off of when the action was completed. Right now the filter is based off of when the inspection was completed and not when the action was completed. When I create a relationship between actions and the date_dim I will get an ambiguity error. 

I would still like to use columns from my inspections table because it includes the location of the actions. How would I be able to allow the user to use the date_dim table to filter based off of a date, but the actions table filters on the action[completed date] and not on the inspection[completed date]? 

Can this be solved using a physical relationship? Do I need a bridge table? Or do I need to create a virtual relationship using treatas or some other DAX function? 


Glad to provide more information if my above explanation is not clear. 

2 REPLIES 2
jdbuchanan71
Super User
Super User

@ElvirBotic 

You can create and inactive relationship between DimDate and Actions the activate it in the measures, something like this.

 

Action Count =
CALCULATE (
    COUNTROWS ( 'Action Table' ),
    USERELATIONSHIP ( 'Action Table'[Action Date], Dim_Date[Date] )
)

Here is an article on USERELATIONSHIP to help you out.
https://www.sqlbi.com/articles/using-userelationship-in-dax/

 

 

@jdbuchanan71 Can you excplain how that would work in a standared table that shows attributed from both tables? i.e. 

action idaudit idaction completed dateaction statusinspection location

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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