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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
oliverblane
Helper III
Helper III

Calculated Measure that Filters Another Table with Inactive Date Relationship

Hi, this is a follow up question this post: https://community.powerbi.com/t5/Desktop/Calculated-Measure-that-Filters-Another-Table/m-p/2454962#M...

 

I would like to extend the solution to handle using inactive date relationships. Table1 looks like:

oliverblane_0-1649926244409.png

and Table2 looks like:

oliverblane_0-1649943197055.png

I would like to calculate the number of distinct PRN values where Course Status = 1, and the start date is within the date slicer range. The measure that I have written for this task is:

 

Distinct Courses 1 - Using Other Date Relationship = 
var _1 = SUMMARIZE(FILTER(Table1, Table1[Course Status] =1), Table1[ID])
return
CALCULATE(
DISTINCTCOUNT(Table2[PRN]),
Table2,
Table2[ID] in _1,
REMOVEFILTERS(Table1[Start Date]),
USERELATIONSHIP(Table1[Start Date], DateTable[Date]))

But it does not seem to respect the inactive relationship seen in the model:

oliverblane_1-1649943435655.png

Here is a sample file: sample_file.pbix

Thanks for any help on this!

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@oliverblane , I check out file and tried a few versions. Can you share an example out output difference - expected vs Actual ?

 

example

 

Distinct Courses 1 - Using Other Date Relationship = 
var _1 = SUMMARIZE(FILTER(CALCULATETABLE( Table1,USERELATIONSHIP(Table1[Start Date], DateTable[Date])), Table1[Course Status] =1), Table1[ID])
return
CALCULATE(
    DISTINCTCOUNT(Table2[PRN]),
    Table2,
    Table2[ID] in _1
    )

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
v-easonf-msft
Community Support
Community Support

Hi, @oliverblane 

Please check the attached pbix. @amitchandak ‘s formula can work for you.

If your problem has been solved, please accept this reply as solution to close this thread, so that other community members will easily find the solution when they get the same issue.

 

Best Regards,
Community Support Team _ Eason

amitchandak
Super User
Super User

@oliverblane , I check out file and tried a few versions. Can you share an example out output difference - expected vs Actual ?

 

example

 

Distinct Courses 1 - Using Other Date Relationship = 
var _1 = SUMMARIZE(FILTER(CALCULATETABLE( Table1,USERELATIONSHIP(Table1[Start Date], DateTable[Date])), Table1[Course Status] =1), Table1[ID])
return
CALCULATE(
    DISTINCTCOUNT(Table2[PRN]),
    Table2,
    Table2[ID] in _1
    )

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.