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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
campelliann
Post Patron
Post Patron

Inactivating Relationship DAX differs from Physically inactivation

Hi there,
 
In the below measure the result is not quite the expected (very subtle difference), but if I physically inactivate the relationship between Table TicketStatus and Tickets the result is correct. In the measure in bold I also inactivate this relation with crossfilter, so why isnt this working? [UPDATE - Solution 1 does not work, Solution 2 does work, but I do not understand why)

Many thanks 

1) This does not work

Calculate
(Countrows('WI in period'),'WI in period'[Hours_consumed]=0, NOT'WI in period'[LastMonthStatus] IN {7,8},Filter(Tickets,Tickets[CreatedDate(Dateformat)]<max('Calendar 2'[Date])),CROSSFILTER(TicketStatus[Id],Tickets[TicketStatusID],None),CROSSFILTER(TicketType[Id],Tickets[TicketTypeID],None),CROSSFILTER(TicketUrgency[Id],Tickets[TicketUrgencyID],None),USERELATIONSHIP(Tickets[Id],'WI in period'[Id]))

2) This works (wrapping calculate with the crossfilter again)

calculate(Calculate(Countrows('WI in period'),'WI in period'[Hours_consumed]=0, NOT'WI in period'[LastMonthStatus] IN {7,8},Filter(Tickets,Tickets[CreatedDate(Dateformat)]<max('Calendar 2'[Date])),CROSSFILTER(TicketStatus[Id],Tickets[TicketStatusID],None),CROSSFILTER(TicketType[Id],Tickets[TicketTypeID],None),CROSSFILTER(TicketUrgency[Id],Tickets[TicketUrgencyID],None),USERELATIONSHIP(Tickets[Id],'WI in period'[Id])),CROSSFILTER(TicketStatus[Id],Tickets[TicketStatusID],none))



3 REPLIES 3
tamerj1
Super User
Super User

Hi @campelliann 

yes I noticed this behavior. In some cases even with USERELATIONSHIP which failed to automatically deactivate the active relationship and I had to manually CROSSFILTER the active relationship to "None". In some cases had to do that by wrapping the first CALCULATE with another one. Still have no explanation of this behavior. 

Hi there @tamerj1 , but what is the difference between my "solution 1 and solution 2". Why does Crossfilter none in the "middle" of the calculate does not work ( I have used this way many times), but wrapping around in solution 2 does work? Does it have to do with evaluation order or something?


Many thanks

@campelliann 
No they're supposed to be applied at the same time. But this may not be possible technically therefore, need to be applied in two steps using two CALCULATE's

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

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.