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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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