The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
I am trying to pass my new measure value which i have created .
That measure i am trying to pass while creating calculated column , but unfortunately the measure value is not retrieved.
Ex : measure_A = year(today()) - 3
ans = 2018
Newcolumn_A = switch(true(),
year('sample'[timePeriod])<[measure_A],0,1)
///where timeperiod is a column in my table.
Solved! Go to Solution.
Hi @shahina14,
You cannot pass a measure into a calculated column, as calculated columns are evaluated at data refresh time, whereas measures are evaluated as a result of user interaction within a report. Put simply: the value of a measure is not really known when a calculated column is evaluated.
This article by Marco Russo (specifically the Choosing between calculated columns and measures section) is a very detailed deep-dive on the concepts and may help clarify further (as well as provide you with knowledge on how you may be able to approach your challenge differently).
In terms of any follow-up and how to solve, you may get better traction by posting a question in the DAX or Desktop forums, as these have a lot more users with DAX-specific knowlegde and you are more likely to receive faster and more targeted assistance.
Good luck,
Daniel
Proud to be a Super User!
On how to ask a technical question, if you really want an answer (courtesy of SQLBI)
Hi @shahina14,
You cannot pass a measure into a calculated column, as calculated columns are evaluated at data refresh time, whereas measures are evaluated as a result of user interaction within a report. Put simply: the value of a measure is not really known when a calculated column is evaluated.
This article by Marco Russo (specifically the Choosing between calculated columns and measures section) is a very detailed deep-dive on the concepts and may help clarify further (as well as provide you with knowledge on how you may be able to approach your challenge differently).
In terms of any follow-up and how to solve, you may get better traction by posting a question in the DAX or Desktop forums, as these have a lot more users with DAX-specific knowlegde and you are more likely to receive faster and more targeted assistance.
Good luck,
Daniel
Proud to be a Super User!
On how to ask a technical question, if you really want an answer (courtesy of SQLBI)
User | Count |
---|---|
8 | |
5 | |
5 | |
4 | |
2 |
User | Count |
---|---|
10 | |
9 | |
7 | |
7 | |
6 |