Forum Discussion
Using measures in calculated columns
Hi Pariksht_verma,
We can create a calculated column to reference a measure value like this: Column1= <measure name>. But you need to note the calculated column values are calculated based on table context so it's fixed. To do further calculation, you can use measure directly without creating additional calculated column. If you have some specific requirement, please share the sample data and expected results for our analysis.
Best Regards,
Qiuyun Yu
Did you find a solution to this? I'm facing a similar issue.
I have a measure that calculates the maximum value in a column on one table. In this case, it is finding the most recent month for which certain information was entered.
- EOMI_LM = max('WInventory)'[Combined Date (Numeric)])
If I place the measure on a visualization page, it will show the current value for it. Currently that expression yields: 201702
Now I want to use the measure in a formula for a calculated column in another table. But it doesn't work. The wrong result will be shown.
- EOMILen_LM = sumx(filter(filter('WInventory','WInventory'[Part #]=zLKPIM[Product #]),'WInventory'[Combined Date (Numeric)]=EOMI_LM),'WInventory'[Pieces on Hand])
However, if I substitute the Measure's formula instead of its name, the calculation will work.
- EOMILen_LM = sumx(filter(filter('WInventory','WInventory'[Part #]=zLKPIM[Product #]),'WInventory'[Combined Date (Numeric)]=max('WInventory'[Combined Date (Numeric)])),'WInventory'[Pieces on Hand])
Or, if I substitute the static value it will also work.
- EOMILen_LM = sumx(filter(filter('WInventory','WInventory'[Part #]=zLKPIM[Product #]),'WInventory'[Combined Date (Numeric)]=201702),'WInventory'[Pieces on Hand])
So then why doesn't it work when I just reference the name? Why can't I use that measure like a variable in the formula for other calculated columns?
Steve
- MilanRao069 years agoAdvocate I
I have a similar problem. Any response on this please?