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

Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more

Reply
AndréNextFit
Frequent Visitor

FILTER after using USERELATIONSHIP function does not work correctly

I need to get the number of customers who canceled, then I need to calculate the reversed accumulated. The problem is that the first measurement returns all blank values, without any errors.

AndrNextFit_0-1673457066269.pngAndrNextFit_1-1673457197214.png

Cancel =
CALCULATE(
DISTINCTCOUNT(dCustumer[Custumer ID]),
USERELATIONSHIP('dCalendar'[Date ID],dCustumer[Cancel Date]),
FILTER(
dCustumer,
dCustumer[Entry Date] < MAX('dCalendar'[Date ID])))

Inverted Acumulated=
CALCULATE(
[Cancel],
FILTER(
ALLSELECTED('dCalendar'),
EOMONTH('dCalendar'[Date ID],0) >= MIN('dCalendar'[Date ID])
)
)

2 REPLIES 2
lbendlin
Super User
Super User

something like this (pseudo code)

Inverted Acumulated=
var mxd = MAX('dCalendar'[Date ID])
var mind = MIN('dCalendar'[Date ID])
return CALCULATE(
DISTINCTCOUNT(dCustumer[Custumer ID]),
USERELATIONSHIP('dCalendar'[Date ID],dCustumer[Cancel Date]),
dCustumer[Entry Date] < mxd,
EOMONTH('dCalendar'[Date ID],0) >= mind
)

Hello, i try your method and dont work again, my perception is that dax has a limitation in this case. After this i make a query in postgresql and work.

Helpful resources

Announcements
PBIApril_Carousel

Power BI Monthly Update - April 2025

Check out the April 2025 Power BI update to learn about new features.

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

April2025 Carousel

Fabric Community Update - April 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors