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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
TomEnns
Helper I
Helper I

Link two date fields of the same table to the same field on the date table.

Hi everyone first time poster here, new to PowerBI, hoping someone can give me some pointers.

 

I have two tables in my data model

  • Dates
    • Date
    • Day
    • Month
    • Year
  • Cases
    • CaseNumber
    • CreatedDate
    • ClosedDate
    • Owner
    • TaskSet

Right now I have a link between the "'Case'[CreatedDate]" field and the "'Date'[Date]" Field.

 

I have three Elelements on my Screen: 

  • Slicer : Linked to 'Date'[Date] field. 
  • Clustered Bar Chart 1: New Cases By Owner
    • Axis: 'Cases'[Owner]
    • Values: Count of 'Cases'[CaseNumber] 
  • Clustered Bar Chart 2: Closed Cases By Owner
    • Axis: 'Cases'[Owner]
    • Values: Count of 'Cases'[CaseNumber] 

As you can probably tell I am looking for one chart to display the number of new cases for the time period selected by the slicer and the second chart to display the number if closed cases in that same time period, both broken down by the case owners. As you can also probably tell I get the same values in each table as I am pulling and linking the exact same values. 

 

Is there a proper method to doing this? I am having the same issue in several places but this is a small example. I am trying to avoid having to pull in my entire dataset twice just to have one dataset for closed and one for new when they are referencing the same source. Any tips are appreciated. 

 

Thanks,

 

edited: Typos

1 ACCEPTED SOLUTION
MattAllington
Community Champion
Community Champion

Read my article here, then post back any questions. https://exceleratorbi.com.au/multiple-relationships-between-tables-in-dax/



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.
I will not give you bad advice, even if you unknowingly ask for it.

View solution in original post

2 REPLIES 2
TomEnns
Helper I
Helper I

Thanks Matt, worked perfectly. For anyone wondering for future reference. Read Matts article it was simple and explaine dthis perfectly. I ended up with two measures: 

Count of Created Cases

Count New Cases = 
CALCULATE(COUNT('Case'[CaseNum]), USERELATIONSHIP(Dates[Date], 'Case'[CaseCreatedDate])
)

Count of Closed Cases

Count Closed Cases = 
CALCULATE(COUNT('Case'[CaseNum]), USERELATIONSHIP(Dates[Date], 'Case'[CaseClosedDate])
)

I placed each of the measures into the values section of thier respective bar charts and it works great. 

MattAllington
Community Champion
Community Champion

Read my article here, then post back any questions. https://exceleratorbi.com.au/multiple-relationships-between-tables-in-dax/



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.
I will not give you bad advice, even if you unknowingly ask for it.

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!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

December 2024

A Year in Review - December 2024

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