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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
scoorix
New Member

Strange behavior of measure CROSSJOIN, ALL, ADDCOLUMNS

Hi, I have a strange problem with the calculation:

 

VAR _ColumnOne =
    ALL ( Customer[Customer])
VAR _ColumnTwo =
    ALL ( 'Product'[Brand Name] )
VAR _Table =
    CROSSJOIN(_ColumnOne, _ColumnTwo)

VAR _PP = ADDCOLUMNS(_Table, "Value", [Profit])

 

 

With this measure, I would expect that _PP table on the table chart that I'm using always looks the same for the next calculation in this measure. But somehow when users make selections with slicers, it seems that context from the table chart is propagated to calculation. 

 

The solution is complex and this is the problematic part. I'm not sure if this always had this problem or maybe it arrived recently. 

Customer and Product tables aren't connected with the relationship. In the table chart, I used both Customer and Brand Name. 

 

Is it possible that row context from the table overwrites the calculation context? And why only when users have applied filters with slicers? 

2 REPLIES 2
AntrikshSharma
Super User
Super User

@scoorix This not a problem, this is a feature, visuals are prepared using SUMMARIZECOLUMNS which depends on Measures used to remove CROSSJOIN (that you are doing explicitly, and is wrong) so that visuals don't render non existing combinations, Profit is from Sales table SUMMARIZECOLUMNS will use the Bridge Table (Sales) to remove non existing combinations.

 

Also your code is incomplete, _PP variable can't be the last step in the execution you need to aggregate that into a scalar value using other functions, what is missing here?

 

Your situation isn't clear so you need to share sample data and some images to show exactly you want to do.

some_bih
Super User
Super User

Hi @scoorix measure returns aggregated amount, like sum or something.

Using ADDCOLUMNS return a table with new columns specified by the DAX expressions.

So your expression return table, not measure.

If you are using this, / your expression as filter argument for CALCULATE which is measure, for sure slicer affect results.





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

Proud to be a Super User!






Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.