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

A new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.

Reply
lcfaria
Helper II
Helper II

Measure returning rows from unrelated projects when filtering

Hi everyone,

 

I need help from the community and I attached the pbix file in the end of this post.

 

I have a data model with the following tables and relationships:

  • f_data fact table

  • d_projects dimension

  • d_calendar dimension

  • d_EntrySource dimension

  • d_Visibility dimension

Relationships are set as follows:

  • d_projects → f_data (one-to-many)

  • d_calendar → f_data (one-to-many)

  • d_EntrySource → f_data (one-to-many)

  • d_Visibility → f_data (one-to-many)

lcfaria_4-1758456347168.png

 

I created a very simple measure:

lcfaria_3-1758456043014.png

When I place this measure in a table visual with project_id and apply a filter to show only project ABC0007, the visual still returns multiple projects (example in screenshots).

  • Without the measure, the filter works as expected (only ABC0007).

lcfaria_1-1758455943018.png

  • With the measure, additional projects that should not be in the filter context appear.

lcfaria_2-1758455991280.png

Questions:

  • Why does adding a constant measure like "_Test = 1" make other projects appear in the visual?

  • What’s the correct way to keep the filter context applied only to the selected project when using this type of measure?

You can find the pbix file in this link: Sample_FilterContext.pbix

Thanks in advance!

1 ACCEPTED SOLUTION
danextian
Super User
Super User

Hi @lcfaria 

Adding  a constant value to a result of a measure is similar to forcing DAXto show 0 when blank. Power BI's VertiPaq engine improves performance by skipping unnecessary calculations when handling blank (null) values. However, if a measure forces zeroes or any other value, the formula engine performs a full cross-join of the dimension tables in the visual, evaluating each row explicitly. This increases query execution time instead of scanning only those rows where records for the combination of the dimension attributes really exist. It can also cause unexpected data points to appear. For example product X, which was terminated in 2013, may still show up for a selected period like February 25, but with zero or other constant values. This isn't the case if all columns are coming from the same table as there's no crossjoin of dimensions from multiple tables that's happening.

 

Why not instead count the distinct project id in your fact table?

danextian_1-1758457366026.png

 

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

View solution in original post

2 REPLIES 2
danextian
Super User
Super User

Hi @lcfaria 

Adding  a constant value to a result of a measure is similar to forcing DAXto show 0 when blank. Power BI's VertiPaq engine improves performance by skipping unnecessary calculations when handling blank (null) values. However, if a measure forces zeroes or any other value, the formula engine performs a full cross-join of the dimension tables in the visual, evaluating each row explicitly. This increases query execution time instead of scanning only those rows where records for the combination of the dimension attributes really exist. It can also cause unexpected data points to appear. For example product X, which was terminated in 2013, may still show up for a selected period like February 25, but with zero or other constant values. This isn't the case if all columns are coming from the same table as there's no crossjoin of dimensions from multiple tables that's happening.

 

Why not instead count the distinct project id in your fact table?

danextian_1-1758457366026.png

 

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Thank you very much for your explanation @danextian, I really appreciate that. Very helpful 👊

Helpful resources

Announcements
Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.