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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
Anonymous
Not applicable

Use active and inactive relationship for DimDate

Hi Everyone,

Is there any way to use both active and inactive relationships in one calculated column? I have the following calculated column;

 

CALCULATE(COUNT(SHIPPING_LINE[KeyID]);
FILTER(CD_OTTC_SHIPPING_LINE;
AND(NOT(ISBLANK(SHIPPING_LINE[CD_OTTC_SHIPPING.STGDTE]));
AND(SHIPPING_LINE[DUEDATE].[Date]<[MAXDIMDATE];
AND(SHIPPING_LINE[CD_OTTC_SHIPPING.STGDTE].[Date]=[MAXDIMDATE];
SHIPPING_LINE[DISPATCH_DTE_2].[Date]=[MAXDIMDATE]))))
 
Since [MAXDIMDATE] is related to only to [DUEDATE] through the SHIPPING_LINE table and only one relationship between two tables is allowed the last two lines do not filter based on [MAXDIMDATE].
Is there any way to workaround this problem?

 

3 REPLIES 3
amitchandak
Super User
Super User

@Anonymous , Not very clear.

First of all Do use .date unless there is a timestamp. If it is datetime. Create a new date column and join with the date table. If you have more than one dates in one table then you need inactive relation and use relation.

 

refer: https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-trend/ba-p/882970

 

or video -https://youtu.be/e6Y-l_JtCq4

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
Anonymous
Not applicable

Yes they all have time stamp hence I use .[Date]. I have more than one date column  in my table and I created one active and 2 inactive relationships between SHIPPING_LINE tabel and Date table. However, I do not know how to use "USERELATIONSHIP" within one calculate function as described above. 

Hi  @Anonymous ,

 

Could you pls upload the relationship schema between tables?

 
Best Regards,
Kelly
Did I answer your question? Mark my post as a solution!

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! It's time to submit your entry.

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.