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
j567boston
Frequent Visitor

Unrelated rows added to table when adding text measure to star schema?

I want to add a text measure to a table in Power BI that is based upon a simple star schema.  One fact table, one dimension table.

 

I want the text measure to be "Pass" or "Fail".  But before I can even make sure my code is correct to calculate the pass or fail, I am getting very strange behavior.  I've built a simple Power BI file to demonstrate, but apparently can't attach it.  It is so simple I will post screenshots to what I did.

 

 

I have a simple data model with a country table (fact table) and related continent table (dimension) with the population by country as the only built in measure.

 

I added a simple constant measure to the fact table: Constant Text Value = "FOOBAR"

 

 

 Simple Star SchemaSimple Star Schema

 

 And when I built a table and leave that constant text measure out, I get a summation of population and I get the expected Hemispheres.  Looks good!

 

Looks good when no Text MeasureLooks good when no Text Measure

 

But when I bring in a constant text measure suddenly I see relationships that don't exist in the data.   Asia isn't in the Southern Hemisphere (at least in my data)

 

Add the Text Measure and suddenly relationships are ignored?Add the Text Measure and suddenly relationships are ignored?

 

Any ideas?   I would expect the text measure to be evaluated per filter context in the table.  But it seems to add filter contexts that don't exist in the data, and only display the sum of population for the relationships that do exist?

 

Huh?  I'm stumped.

 

Thanks for any clue you could give!

 

-Jeff

 

7 REPLIES 7
edhans
Super User
Super User

In your Countries table, do you have Countries in it that don't have a population, but do have your FOOBAR text? 



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

Nope.  See below for all data.

 

Countries TableCountries TableContinents TableContinents Table

I'm looking at this more today.  It looks more and more like adding the constant text measure caused a cross join.   *scratches head*

More information:

 

1) If you remove the attribute on the dimension table (Hemisphere) then the problem goes away.

 

2) The behavior is identical in Power Pivot.

I've found a work around - Filter "Population" for "is not blank".

 

Which works.... but I feel this represents something I fundamentally don't understand about Power BI.

@j567boston,

 

DAX Studio can be used to capture queries, you may have a look.

https://msdn.microsoft.com/en-us/query-bi/dax/summarizecolumns-function-dax#return-value

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

You are suggesting to use a function that only returns a value on certain field groupings?

 

Thanks!

 

 

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.