Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
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?
@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.
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.
Proud to be a Super User!
User | Count |
---|---|
16 | |
15 | |
14 | |
12 | |
11 |
User | Count |
---|---|
19 | |
15 | |
14 | |
11 | |
9 |