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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Crossfilter not working as excpected

Hello,

 

I am trying to calculate new subscribers and leavers.

It seems simple, but it doesn't work.

 

Here are the DAX measures:

 

Count Join =
COUNT ( Subscribers[Registration_ID] )

 

Count Leavers =
CALCULATE (
COUNT ( Subscribers[DateLeft] ),
CROSSFILTER ( 'Calendar'[Date], Subscribers[DateLeft], ONEWAY )
)

 

Here is the PBIX file:

https://basintamir-my.sharepoint.com/:u:/g/personal/tamir_tamirbasin_com/EXjrPKCMhP5LpwEJzQ1VMpsBpgG...

 

Thanks for any help,

Tamir

1 ACCEPTED SOLUTION

Hi!

 

Instead of the CROSSFILTER function you should use the USERELATIONSHIP function to activate your inactive relationship.

 

Br,

Magnus

View solution in original post

5 REPLIES 5
v-yulgu-msft
Employee
Employee

Hi @Anonymous,

 

I was not very clear about your problem. You said "it doesn't work", while what is the desired result? Could you please illustrate the scenario with less data to help me better understand?

 

Regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Hi @v-yulgu-msft

 

There is a list of people who joined at a certain date (Joineddate).

Some left  (Leftdate).

 

In order to use the calendar table, in the data model, I create a link between the dimCalendar[date] to the [JoinedDate].

However, to measure the correct number of leavers I need to link the [LeftDate] instead to the dimCalendar[date].

For that reason, I created an inactive connection in the data model and I am trying to activate it through the Crossfilter function for that purpose only (count leavers by month).

 

Please see the linked file:

MonthlySubscriberCountbysummarizeCorrect

 

It shows the correct number of leaves per month.

It is done with a different method but I am trying to reproduce the result using the crossfilter function.

 

I hope it is clearer now,

 

Thank you for your time

Regards

Tamir

 

 

 

Hi!

 

Instead of the CROSSFILTER function you should use the USERELATIONSHIP function to activate your inactive relationship.

 

Br,

Magnus

This article will help to futher understand why USERELATIONSHIP() is better than CROSSFILTER()
https://www.inkeysolutions.com/blogs/power-bi-userelationship-vs-crossfilter/

Anonymous
Not applicable

@magsod

Thank you.

 

Works like a charm 🙂

 

Regards

Tamir

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.