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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Star Schema Filtering by Project Name in Fact Table

ADPowerBI1_0-1694512858885.png

Hello, I have the above star schema. However on one of my pages there needs to be a filter on "Project Name". 
Project Name appears in my Fact table. So unless i enable bidirectional filtering between all dim tables my project name column will not filter my data correctly. 

I have tried creating a "DIM Project" table that contains the project name and an index that I have generated with Power Query:

ADPowerBI1_1-1694515321362.png


I have then merged this table to my fact table on the project name and only kept the Index in my fact table. 
The model now looks like this:

ADPowerBI1_3-1694515437592.png


Relationship:

ADPowerBI1_4-1694515460150.png



I thought this would allow me to filter by Project name but this for some reason does not link to any of my other data and when I filter on my report nothing changes when I filter by this Project Name from DIM Project.

 

Can anyone help me figure out why?

 

Thanks

5 REPLIES 5
Anonymous
Not applicable

Hi @Anonymous 

You can use crossfilter() function in a measure to implement the filter

e.g 

 

Measure =
CALCULATE (
    SUM ( table[sales] ),
    CROSSFILTER ( dimtable[projectname], facttable[projectname], BOTH )
)

 

You can refer to the following link about more of the function.

CROSSFILTER function - DAX | Microsoft Learn

 

Best Regards!

Yolo Zhu

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

 

Anonymous
Not applicable

Sorry, i am confused. I have no sales data in my model, only project management data (project names etc). 
What is your suggested outcome here?

If i write a correct dax measure will i be able to turn my relationships to single direction in my data model? 

 

Not sure where you're going with this one, any help would be appreciated.

 

Thanks for your reply 🙂 
Kind regards

AD

Anonymous
Not applicable

Hi @Anonymous 

The code just the sample, I meant you can use the crossfilter() function. and you can set the crossfilter to single when you use the funciton.

 

Best Regards!

Yolo Zhu

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

 

Anonymous
Not applicable

Sorry, i don't think this answers my question.

How does this help me set my relationships to single in the data model and still be able to filter by project name from my fact table? My problem is that i have a star schema but i want to be able to filter by the project name in the fact table. To do this currently, i have to set all my relationships to bi-directional so that the fact table can filter values from the dim tables, which is not how a sound star schema is meant to work. 

 

My question is how do i approach solving this issue, i need to filter by the project name (in fact table) AND have my relationships between fact and dim tables as single direction. 

 

I'm not sure how the crossfilter function is meant to help here... I need my project name slicer to filter my data.

Anonymous
Not applicable

Bump

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.