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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Adding a simple constant valued measure stops breaks relationships in drill down table visual - why?

 

 

Hi All,

I have a simple data model and an accompanying Power BI driven by XLSX file.   

 

Model

sau001_1-1639605027524.png

Every User in the users table has 1 or more sales records in the Sales table

 

List of tables

  1. Users
  2. Sales

 

Sample data

Sales

sau001_2-1639605071638.png

 

User

sau001_3-1639605097224.png

 

Power BI Visual

Overview table

visual showing all Sales persons from Users table

sau001_4-1639605274422.png

 

 

Details table

This shows all the sales records for that sales person

sau001_5-1639605357925.png

sau001_8-1639606253034.png

 

 

Sample measure

sau001_6-1639605431139.png

I have a dummy table called AllMeasures just as a place holder for all measures.  I have created the following measure, which as you can see returns a constant value.

 

MyConstantValue = 123
 

 

Problem

When I add the measure MyConstantValue to the Sales table visual on the drill through report Tab, the table visual starts displaying records for all users.  In the example below, the table visual is now showing jane under userid.

sau001_7-1639605801549.png

 

Why? If I remove the measure MyContantValue, all works fine.

 

 

Accompany XLSX and PBIX

PBIX

Excel data file

 

 

1 ACCEPTED SOLUTION

Hey @Anonymous ,

Thanks for showing and clarifying. Try this.

Modify your measure so that it is looking at the userid before returning 123. 

 

MyConstantValue = 
VAR userid = SELECTEDVALUE(users[userid])
RETURN
IF(userid<>"",123,0)

 

Then filter MyConstantValue to greater than 0.

Watsky_2-1639667038198.png

With John selected:

Watsky_5-1639667217321.png

 

With Jane selected:

Watsky_4-1639667197687.png

 

The issue is that there isn't a relationship between your measure and the tables so Power BI isn't sure how to handle it. Because of the lack of a relationship that is also why you were seeing blank values. When there is ambiguity Power BI will give all dimensions all possible values. 

Watsky_3-1639667172287.png

So with the measure and filter change you remove all the ambiguous values leaving only the values you are needing.

Hope this helps!

 


Did my answer(s) help you? Give it a kudos by clicking the Thumbs Up!
Did my post answer your question(s)? Mark my post as a solution. This will help others find the solution.

Proud to be a Super User!

View solution in original post

6 REPLIES 6
Anonymous
Not applicable

Hi @Watsky,

I can demonstate this inexplicable behaviour even withou having any drill through reports.

 

Step 1 - A table which shows userid and total sales per userid

All the fields in the table visual are from Sales table

sau001_0-1639662018032.png

 

Step 2 - Add First Name and Last Name to the table

We want to enhanced the visualization by bringing in more user details

sau001_2-1639662208852.png

 

Step 3 - Now add the constant Measure

sau001_3-1639662397897.png

 

 

I am unable to explain how the 2 extra rows got added when I added the measure to the table visual.  

 

Thank you,

Sau

 

Watsky
Solution Sage
Solution Sage

Hey @Anonymous ,

Looks like you're pulling the userid field from the Sales table. Instead, pull it from the users table and change your filter to the userid from the users table. 

Watsky_1-1639612447107.png

 


Did my answer(s) help you? Give it a kudos by clicking the Thumbs Up!
Did my post answer your question(s)? Mark my post as a solution. This will help others find the solution.

Proud to be a Super User!

Anonymous
Not applicable

Hello @Watsky ,

 

Thanks for replying. Your approach looks promising. However, if you notice closely, you will see that Sales records for Jan Doe have also been pulled in your Visualization. (red rectangle)

sau001_0-1639661256240.png

 

If I were to remove the constant valued measure, then there is no problem at all.

Without the measure

Looks good. The drill down table shows records for John Doe only

sau001_1-1639661356481.png

 

 

With the measure

Putting the measure back into the visual - we see all sales records !!! We only wanted John's records.

sau001_2-1639661528725.png

 

Any thoughts?

 

Sau

 

 

 

 

Hey @Anonymous ,

Thanks for showing and clarifying. Try this.

Modify your measure so that it is looking at the userid before returning 123. 

 

MyConstantValue = 
VAR userid = SELECTEDVALUE(users[userid])
RETURN
IF(userid<>"",123,0)

 

Then filter MyConstantValue to greater than 0.

Watsky_2-1639667038198.png

With John selected:

Watsky_5-1639667217321.png

 

With Jane selected:

Watsky_4-1639667197687.png

 

The issue is that there isn't a relationship between your measure and the tables so Power BI isn't sure how to handle it. Because of the lack of a relationship that is also why you were seeing blank values. When there is ambiguity Power BI will give all dimensions all possible values. 

Watsky_3-1639667172287.png

So with the measure and filter change you remove all the ambiguous values leaving only the values you are needing.

Hope this helps!

 


Did my answer(s) help you? Give it a kudos by clicking the Thumbs Up!
Did my post answer your question(s)? Mark my post as a solution. This will help others find the solution.

Proud to be a Super User!

I'm struggling to understand "there isn't a relationship between your measure and the tables", because I have a measure that does reference some tables, and as far as I can tell there are unabiguous relationships between the tables of all columns referenced in my measure and table visual, yet I'm seeing this phenomenon where a relationships is ignored and Power BI gives all possible values to some fields. I'm not asking for a solution but perhaps you could refer me to documentation that touches on this. Could it be that table visuals including multiple facts with multiple common dimensions do this when a measure is added that manipulates one of the conformed dimensions' filters?

 

Edit: 

I found the answer by turning on Performance Analyzer in PBI Desktop to capture the DAX generated by my table visual, then I read up on the SUMMARIZECOLUMNS() function it uses (on Microsoft website and dax.guide), which explained that it computes the cartesian product of the input columns, ignoring all actual relationships and data rows, then relies on measures returning blank to exclude combinations of the input fields that do not exist in the underlying data/relationships. If you don't give any measures but you reference multiple tables in your table visual, Power BI automatically adds a COUNTROWS() measure, uses it to remove rows, then trims off the column so you never see it.

 

My measure wasn't working in my table visual because I had fields from multiple tables with a common dimension, and my measure needed to override only one of the relationships between that dimension and the other tables. I fixed it by, rather than overriding the filter on the dimension table, disabling one of its relationships with CROSSFILTER(..., ..., None) and substituting it with a filter on the relationship key on the many side of that relationship.

I found the answer by turning on Performance Analyzer in PBI Desktop to capture the DAX generated by my table visual, then I read up on the SUMMARIZECOLUMNS() function it uses (on Microsoft website and dax.guide), which explained that it computes the cartesian product of the input columns, ignoring all actual relationships and data rows, then relies on measures returning blank to exclude combinations of the input fields that do not exist in the underlying data/relationships. If you don't give any measures but you reference multiple tables in your table visual, Power BI automatically adds a COUNTROWS() measure, uses it to remove rows, then trims off the column so you never see it.

 

My measure wasn't working in my table visual because I had fields from multiple tables with a common dimension, and my measure needed to override only one of the relationships between that dimension and the other tables. I fixed it by, rather than overriding the filter on the dimension table, disabling one of relationships with CROSSFILTER(..., ..., None) and substituting it with a filter on the relationship key on the many side of that relationship.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors
Top Kudoed Authors