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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
athogan
New Member

Two tables have date columns but date slicers from either table will not drive both


I have an iVent table and a Discharge table in a power bi dashboard. They are linked on Department and they both have date columns that are in the same format. When I add a date slicer from the Discharge table it only filters data from that table and vice versa. I have tried adding a seperate date table but if I join on date the departments do not sync. How do I fix this issue??

athogan_0-1714664039584.png




2 ACCEPTED SOLUTIONS
DataNinja777
Super User
Super User

Hi @athogan ,

 

Your data model has to be a star schema, meaning, that there should be dimension tables and fact tables in your data model. Currently, your data model has many to many relationship between the fact tables, with the department key.  Instead, it is recommended that you do not allow many to many relationship in your data model.  First, you can create a dimension table of department which should be linked to both 'Discharges' and 'iVents' fact tables where Department dimension table is one side of the relationship and 'Discharges' and 'iVents' fact tables are many sides of the relationship.  Similarly, you can create a calendar dimension table and create relationship with both 'Discharges' and 'iVents' fact tables's date fields.  Once you sorted out your data model structure in the standard star schema way, your dax and filtering will be much easier.  

Best regards,

View solution in original post

Anonymous
Not applicable

Hi @athogan ,

@DataNinja777 Thanks for your concern about this case!

And @athogan have you solved your problem? If not, and if I understand correctly, you want to filter the Discharge table by date and at the same time the table iVent will show the data that is within the filter date range and the department is the same as the table Discharge, right?
Here is my sample data:

vjunyantmsft_0-1715324767883.pngvjunyantmsft_1-1715324775483.pngvjunyantmsft_2-1715324781851.png

And here is the relationship:

vjunyantmsft_3-1715324802808.png

Use this DAX to create a measure:

 

 

Measure = 
IF(
    MAX('iVent'[Date]) <= MAX('Calendar'[Date]) && MAX('iVent'[Date]) >= MIN('Calendar'[Date]) && MAX('iVent'[Department]) IN VALUES(Discharge[DepartmentName]),
    1,
    0
)

 

 

Follow the diagram below to set up:

vjunyantmsft_0-1715324990861.png

And the final output is as below:

vjunyantmsft_1-1715325030748.png
vjunyantmsft_2-1715325040887.png


Best Regards,
Dino Tao
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

2 REPLIES 2
Anonymous
Not applicable

Hi @athogan ,

@DataNinja777 Thanks for your concern about this case!

And @athogan have you solved your problem? If not, and if I understand correctly, you want to filter the Discharge table by date and at the same time the table iVent will show the data that is within the filter date range and the department is the same as the table Discharge, right?
Here is my sample data:

vjunyantmsft_0-1715324767883.pngvjunyantmsft_1-1715324775483.pngvjunyantmsft_2-1715324781851.png

And here is the relationship:

vjunyantmsft_3-1715324802808.png

Use this DAX to create a measure:

 

 

Measure = 
IF(
    MAX('iVent'[Date]) <= MAX('Calendar'[Date]) && MAX('iVent'[Date]) >= MIN('Calendar'[Date]) && MAX('iVent'[Department]) IN VALUES(Discharge[DepartmentName]),
    1,
    0
)

 

 

Follow the diagram below to set up:

vjunyantmsft_0-1715324990861.png

And the final output is as below:

vjunyantmsft_1-1715325030748.png
vjunyantmsft_2-1715325040887.png


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

DataNinja777
Super User
Super User

Hi @athogan ,

 

Your data model has to be a star schema, meaning, that there should be dimension tables and fact tables in your data model. Currently, your data model has many to many relationship between the fact tables, with the department key.  Instead, it is recommended that you do not allow many to many relationship in your data model.  First, you can create a dimension table of department which should be linked to both 'Discharges' and 'iVents' fact tables where Department dimension table is one side of the relationship and 'Discharges' and 'iVents' fact tables are many sides of the relationship.  Similarly, you can create a calendar dimension table and create relationship with both 'Discharges' and 'iVents' fact tables's date fields.  Once you sorted out your data model structure in the standard star schema way, your dax and filtering will be much easier.  

Best regards,

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors