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

Issues with CrossFilter

Hi,

I have 2 columns Accounting and Date joined via Both side filter in model. For a measure, I am using crossfilter to override this join as Single side -

 

My crossfilter on Accounting and Date table works as expected, when I run the following DAX (i.e. returns values for dates which might not have accounting entries):

Cumulative Amount=
var total = CALCULATE([Amount],CROSSFILTER('Date'[Date],Accounting[Effective Date],OneWay),ALLSELECTED('Accounting'))
return total
 
But the results are not as expected when I add an additional filter on date (i.e. it does not return values for the dates where there are no entries in accounting:
Cumulative Amount=
var total = CALCULATE([Amount],CROSSFILTER('Date'[Date],Accounting[Effective Date],OneWay),FILTER(all('Date'),'Date'[Date]<=max('Date'[Date])),ALLSELECTED('Accounting'))
return total
 
Is that a limitation or is there a workaround?
2 REPLIES 2
amitchandak
Super User
Super User

@Anonymous , Looking at this I am not sure on the need of ALLSELECTED('Accounting')

 

remove that and try. Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

Anonymous
Not applicable

@amitchandak , I am unable to share any file outside my org network.

 

The ALLSELECTED('Accounting') was used from my original which is slightly more complex. But even after removing that there is no change in output:

Amount (As on date) - INR =
var total = CALCULATE([Amount (For the period) - INR],CROSSFILTER('Date'[Date],Accounting[Effective Date],OneWay),FILTER(all('Date'),'Date'[Date]<=max('Date'[Date])))
return total
Following is the output when I use both side filter b/n Accounting and Date: 

 

Shailee_0-1600665195824.pngShailee_1-1600665367829.png

 

Following is the expected/required output achieved with single side filter b/n Accounting and date:

Shailee_2-1600665451839.png

Shailee_3-1600665482115.png

But I need to keep the Filter b/n Accounting and Date to Both side for some other use case, hence was tring to override the filter just for this measure. But its not working. Any idea, where its going wrong?

 

Thanks,

Shailee

 
 
 

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.

Top Solution Authors