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.
Hi all,
I could use some help with the following..
This is my model:
The data looks like:
The table 'Factor' goes from 0,00 to 2,00 in increments of 0,01.
Now, I'd like to have a table with Products and a Yearly Sales (target) per product. The twist is that I'd like to add a variable 'factor' to the Yearly Sales:
In the example above, I have chosen for a factor of 0,72. This means the 'Result' should show a 'new' Yearly Sales like:
0,72*1000 for ProductID = 532
0,72*1500 for ProductID = 924
0,72*3000 for ProductID = 348
Now, I really need this resulting column to be a calculated column (not a measure). This has to do with further calculations I want to make. I thought this would be really simple by creating a calculated column like:
Yearly Sales (calc) = max(Factor[Factor])*Products[YearlySales]
However, this calculated column just fetches the maximum factor of 2,00, not taking my filter selection into account.
Alternatively, I tried creating a measure in 'Products' first that fetches the factor by:
Chosen Factor = max(Factor[Factor])
And then uses this measure in a calculated column:
Yearly Sales (calc 2) = Products[YearlySales] * [Chosen Factor]
But nothing I tried seems to work:
Does anyone have idea how to make this work (with the final result being a calculated column)?
Help is very much appreciated. 🙂
Hi @zudar ,
As far as i know, the result of calculated column won't be affected by silcer. So you need to use measure or you can create a calculated table contains all values with different factors then use silcer to filter the table.
Best Regards,
Jay
Community Support Team _ Jay Wang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
It is impossible to use a column calculated by design for this requirement.
A computed column is calculated during table load and then stored in the model. Therefore, you cannot change based on a report parameter.
You have to redesign your other measurements, to work with a measure instead.
Explanation of the differences between calculated columns and measures:
https://www.sqlbi.com/articles/calculated-columns-and-measures-in-dax/
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
111 | |
100 | |
80 | |
64 | |
58 |
User | Count |
---|---|
146 | |
110 | |
93 | |
84 | |
67 |