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
Stuznet
Helper V
Helper V

Drill through Count Based on Two Dates

Hi guys,

 

I have 2 dates fields and I need to count the prjacct based on two dates. 

So, I created a Date table, then I create another table for the

End Date

End Date = SUMMARIZE(Data,
                        [End Date],
                        [PrjAcct])

Then I create relationships 

Capture2.PNG

The problem I'm having is when I drill through Row 1 "33" I'm not getting the correct result in Page 2. Is giving me 110 instead.

 

Capture.PNG

 

Capture3.PNG

 

Here is the PBIX file

 

Any idea how do I fix this issue?

 

Really appreciated!

1 ACCEPTED SOLUTION

@TeigeGao 

I found a solution. I follow this link and I aggregate the dates.

I recreate the relationship and set the End Date relationship to Inactive in order to utilize the

USERELATIONSHIP function. and make the Start Date an active relationship.
Capture.PNG

I rewrite the measure

Measure = SWITCH(TRUE(),
            MAX('Row'[Row]) = "Row 1",
                COUNT(Data[PrjAcct]),
                
            MAX('Row'[Row]) = "Row 2",
                CALCULATE([Count of ProjAcct],USERELATIONSHIP('Dim Date'[Date], Data[End Date])))

Drag the dim date and the measure to the data table. Now when I drill through is showing me the correct result.

Capture1.PNG

View solution in original post

2 REPLIES 2
TeigeGao
Solution Sage
Solution Sage

Hi @Stuznet ,

The measure can't be used in drill through, as a result, the filter on Row haven't transferred to the report page 2.

Best Regards,

Teige

@TeigeGao 

I found a solution. I follow this link and I aggregate the dates.

I recreate the relationship and set the End Date relationship to Inactive in order to utilize the

USERELATIONSHIP function. and make the Start Date an active relationship.
Capture.PNG

I rewrite the measure

Measure = SWITCH(TRUE(),
            MAX('Row'[Row]) = "Row 1",
                COUNT(Data[PrjAcct]),
                
            MAX('Row'[Row]) = "Row 2",
                CALCULATE([Count of ProjAcct],USERELATIONSHIP('Dim Date'[Date], Data[End Date])))

Drag the dim date and the measure to the data table. Now when I drill through is showing me the correct result.

Capture1.PNG

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.