Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Convert Calculate Column to Measure

Hi Experts

 

I have the following Calculated Column calculation which i would like to convert to a measure..

Pre_Value =
VAR MyIndex = Input[Period]
VAR MyP = Input[Time Period No]
VAR PreviousIndex = Calculate(Max(Input[Period]),Filter(input,Input[Time Period No] = MyP && Input[Period] < MyIndex))

VAR Result = Calculate(Max(Input[ValPercentage]),Filter(Input,Input[Period] = PreviousIndex && Input[Time Period No] =MyP))
Return
Result

 

 

  • Hello Anonymous ,

     

    calculated columns and calculated measures are two different concepts.

    You cannot always convert one to the other as they have different result and behavior.

     

    So the question is why do you want to convert it to a measure? And how should the result look like?

     

    If you need any help please let me know.
    If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
     
    Best regards
    Denis
     

2 Replies

  • selimovd's avatar
    selimovd
    Most Valuable Professional

    Hello Anonymous ,

     

    calculated columns and calculated measures are two different concepts.

    You cannot always convert one to the other as they have different result and behavior.

     

    So the question is why do you want to convert it to a measure? And how should the result look like?

     

    If you need any help please let me know.
    If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
     
    Best regards
    Denis
     
  • v-henryk-mstf's avatar
    v-henryk-mstf
    Community Support

    Hi Anonymous ,

     

    As selimovd  said, calculated column and measure are two different concepts. To realize the mutual conversion between them, you need to know the specific data model and the expected expected result, otherwise it cannot be directly converted through the formula. Can you provide test data and expectations? As a result, it is convenient for me to answer you as soon as possible.


    Let me know immediately, looking forward to your reply.

    Best Regards,
    Henry

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.