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
DanielCarvalho
Helper III
Helper III

USERELATIONSHIP()

Hello guys, I have an issue with 3 of my tables where I am unable to make some of the relationships I need active. When I searched about this issue I see many people suggest creating measures with the userelationship() function. I tried to apply this to my own case but whenever I try I haven't managed to make it work. Could you give a suggestion of how I could fit this function into my measure? 

 

Created Cumulatitive = CALCULATE(COUNT('Distinct Tickets'[ActionDate]),filter(allselected('CALENDAR'),'CALENDAR'[DATE] <=max('Distinct Tickets'[ActionDate])))
 
In this case the distinct tickets table does not have a direct connection to the calendar table.
1 ACCEPTED SOLUTION
puneetvijwani
Resolver IV
Resolver IV

@DanielCarvalho you probably need to create an inactive relationship between action date and your calendar date table and change the DAX to below 

Created Cumulative =
CALCULATE(
COUNT('Distinct Tickets'[ActionDate]),
USERELATIONSHIP('Distinct Tickets'[ActionDate], 'CALENDAR'[DATE]),
FILTER(
ALLSELECTED('CALENDAR'),
'CALENDAR'[DATE] <= MAX('Distinct Tickets'[ActionDate])
)
)

-------------------------------------------------------------------------------------------------------------------------------
"Good day, amigo! Have I provided the solution ? If so, please let me know by adding the lovely, sweet "solution" tag to my post. And hey, if you're feeling very kind, give me a Kudos; after all, who doesn't enjoy a little digital gratitude?"

View solution in original post

1 REPLY 1
puneetvijwani
Resolver IV
Resolver IV

@DanielCarvalho you probably need to create an inactive relationship between action date and your calendar date table and change the DAX to below 

Created Cumulative =
CALCULATE(
COUNT('Distinct Tickets'[ActionDate]),
USERELATIONSHIP('Distinct Tickets'[ActionDate], 'CALENDAR'[DATE]),
FILTER(
ALLSELECTED('CALENDAR'),
'CALENDAR'[DATE] <= MAX('Distinct Tickets'[ActionDate])
)
)

-------------------------------------------------------------------------------------------------------------------------------
"Good day, amigo! Have I provided the solution ? If so, please let me know by adding the lovely, sweet "solution" tag to my post. And hey, if you're feeling very kind, give me a Kudos; after all, who doesn't enjoy a little digital gratitude?"

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.