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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Date dimension filtering multiple fact tables

I am trying to use a date dimension accross multiple tables in my power BI report, however I can't get the relationships to work.

I am comparing a monthly budget with the mothly accounting. Here is some sample data:

 

Budget table

DateCategoryAmount
07.2019R&D100
07.2019Administrative120
08.2019R&D150
08.2019Administrative75
08.2019Wages100
09.2019R&D135
09.2019Administrative95
09.2019Wages100
10.2019Administrative20
10.2019Wages250
11.2019Administrative200

 

Accounting table

DateCategoryDescriptionAmount
07.2019R&DIT Costs50
07.2019R&DLicenses60
07.2019AdministrativeRent80
07.2019AdministrativeOffice supplies45
08.2019R&DIT Costs100
08.2019R&DLicenses70
08.2019AdministrativeRent75
08.2019WagesSalaries95
09.2019R&DIT Costs120
09.2019R&DLicenses40
09.2019AdministrativeRent90
09.2019WagesSalaries105
10.2019AdministrativeRent20
10.2019AdministrativeOffice supplies10
10.2019WagesSalaries240
11.2019AdministrativeRent185

 

My date table is pretty standard, having all the date attributes, including mm.yyyy I'm using in the previous two tables.

I have a relationship based on the category column between my budget and accounting tables which allows me to compare the amounts, configured as follows:

https://imgur.com/a/uWfxrbE

 

The end result I'd like to get is this:

https://imgur.com/a/8s1L0rp

 

A comparison of the budget and the accounting, and a date filter which filters all the data.

I can get an active relationship between my date table and one of the tables, but for the other table I get this message:

"You can't create a direct active relationship betwwen Budget and DimDate because an active set of indirect relationships already exists between these tables. To make this relationship active, set the Cross filter direction to "single", delete, or deactivate any of the indirect relationships first."

 

How can I get my date table to be linked to all the tables in my report ?

 

Thanks

1 REPLY 1
v-jayw-msft
Community Support
Community Support

Hi @valentin,

 

If I understand you correctly, UseRelationship function might be helpful for you.

Please check following steps as below and see if the result achieve your expectation:

1. Create inactive relationship between Budget and Date:

1.PNG

2. Create measures:

    accounting = CALCULATE(SUM(Accounting[Amount]),FILTER(Accounting,Accounting[Category] = MAX(Accounting[Category])))

    budget = CALCULATE(SUM(Budget[Amount]),FILTER(Budget,Budget[Category]= MAX(Budget[Category])),USERELATIONSHIP(Budget[Date],'Date'[Date]))

3. Result would be shown as below:

2.PNG3.PNG

BTW, Pbix as attached, hopefully works for you.

 

Best Regards,

Jay

 

Community Support Team _ Jay Wang

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

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors