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
Anonymous
Not applicable

Measure creates cartesian

I'm trying to understand why this measure is creating a cartesian product. It's simple to reproduce:

Two tables Dim and Fact. Dim has only a DimId column, fact has dimId and a date column.

 

Measure1:

MaxDate = max(fact[DateColumn])

Measure2:

DoSomeBusinessStuff = //check is max date in context is in future, if yes, do something, if no, do something else
VAR MaxDate = [MaxDate]
VAR MaxDateIsInFuture = [MaxDate] > TODAY()
RETURN
IF( MaxDateIsInFuture , 1+1 , 5*20 )

If I create a table viz out of dim.DimId and MaxDate, and then a slicer on dim.DimId - the resulting table respects the filter propagated from dimension. However, if I drop DoSomeBusinessStuff in, the table returns a cartesian of Fact+Dim tables, and for the life of me I don't know why.

 

In the DoBusiness measure it's the MaxDate > TODAY() that causes it, but I can't understand why that would.

 

Any help?

 

 

fact tablefact tabledim tabledim tablerelationshiprelationshipMax Date  - no catesianMax Date - no catesianDoBusiness - WHAT?DoBusiness - WHAT?

 

 

 

 

 

 

4 REPLIES 4
Marcin82
Frequent Visitor

Anonther question without a real answer. Such a great forum...

MattAllington
Community Champion
Community Champion

 What are you trying to do here? Where are the dim IDs coming from  - the ones placed on rows and columns? It looks like you have dim ID coming from both tables in this visual.   Why are you doing that and what do you expect to achieve?    The dim ID from your fact table will not filter your dimension table.   That is why you have a cartesean join



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.
I will not give you bad advice, even if you unknowingly ask for it.
Anonymous
Not applicable

did you try to reproduce the issue here? takes a couple minutes to create the data model I've posted.

 

I've had no luck and it makes no sense to me. 

Anonymous
Not applicable

The two IDs on the visual are to demonstrate that the dimension filter is not passing to fact. Even if I take the id's off, the cartesian effect stays there - without showing the id's the resultset is even more confusing. 

 

The production version of this looks to MaxDate to see if the last date in filter context is in the future or not, and toggles the calculation returned, but comparing MaxDate to TODAY() causes the table to explode. Doesn't matter if it's table or matrix, doesn't matter if dimid's are actuall on the visual, the resultset in visual goes totally haywire and doesn't respect the filter from dim.DimId slicer. 

 

Give it a try - those two tables and a handful of values are all you need to get weirdness. I wish this forum allowed me to upload an example file. 

Helpful resources

Announcements
May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

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.