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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
av9
Helper III
Helper III

Crossfilter with multiple fact tables

Hi 

I am looking to get some advice on the best way to proceed with this model.

 

I believe my 2 options are : 

1) Use DAX Crossfilter function

2) Turn on bi-directional filtering (i.e. Both) in the model  

 

av9_1-1627625418249.png

 

I have a matrix table and it contains data from Customer, Transactions and Stock Price Email , Monthly Newsletter.

av9_2-1627625886275.png

I tried to build the coumns of the matrix using DAX Crossfilter function, for example:

Company (Matrix) = CALCULATE (
SELECTEDVALUE ( Customer[Company] ),
CROSSFILTER ( Transactions[CustomerID], Customer[CustomerID], BOTH )
)

This works when filtering by Customer columns, but when I try and filter by Stock Price Email or Monthly Newsletter the whole matrix table is not filtered , just the columns Stock Price Email or Monthly Newsletter. this is the DAX.

Stock Price Email Status (Matrix) = CALCULATE (
SELECTEDVALUE ( 'Stock Price Emails'[Status]),
CROSSFILTER ( Transactions[CustomerID], Customer[CustomerID], BOTH ),
CROSSFILTER ( 'Monthly Newsletter'[CustomerID], Customer[CustomerID], BOTH ),
CROSSFILTER ('Stock Price Emails'[CustomerID], Customer[CustomerID], BOTH )
)

I am not sure if I have applied the Crossfilter function correctly. My alternative is to turn on bi-directional filtering on these tables which works, but I want to ensure I follow best practice and this is why I am looking for any guidance.

 

I have attached the PBIX I am working with.

 

https://drive.google.com/file/d/1hNamdGFS4_ohIY2gsaO9dtgy6c2vWN4K/view?usp=sharing

 

Thanks in advance.

4 REPLIES 4
amitchandak
Super User
Super User

@av9 , what you want to filter , say if you want customers from transaction that has newsletters

 

 

countx(values(customer[customer]), if(not(isblank([newsletter measure])) && not(isblank([transaction measure])) , [customer], blank())

 

So what you wnat to get here, please let us know.

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

I want to be able to filter the matrix by the status. So in the screenshot 1 if I pick the slicer it should remove rows I marked in red. I can achieve this by using bi-directional filter but want to get some advice if this is the right way to go or should I use DAX.

av9_0-1627631017207.png

 

this is what it should look like:

av9_1-1627631178220.png

 

 

Hi @av9 ,

 

You can set the value is not blank in Filters.

6.png

 

 

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks, it probably doesnt show in this example report but I also have some customers who have blank as there preference. 

 

So even when I apply this filter and slicer it filters the column but the ones that are blank still show.

 

av9_1-1628156861933.png

Crossfilter example 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

Feb2025 NL Carousel

Fabric Community Update - February 2025

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

Top Kudoed Authors