Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago

Meassure with replace/substitue

Okay guys

 

I need to find out how to solve this. 

 

Your help is much appreciated. 

 

As you can see in the picture the measure "Return Value" is the same measure as above just with a minus.

 

When I take that meassure into a pivottable as a vakue and select column SO art and colmn Prognose as rows ; I want  column "SO art" ZP01 to be ZP00, but only for PrognoseID 9002970.

 

Its important to do it in a measre and not a column, if possible. I tried to read about substitute but could not really make it work. 

Is there anyway to solve this? or next best would be in  a calculated column.

 

I want the new measure to have the same value, but some values in one column based on another coulmns ID, need to be swtiched. (only for this meassure).

 

So in the end when I out both values in a table with SO art og Prognose ID as rows we would see that prognose ID 9002970 has SO art ZP01 in first measure "value with original string" but ZP00 in measure "Return Value"

 

3 Replies

  • Greg_Deckler's avatar
    Greg_Deckler
    Icon for Community Champion rankCommunity Champion

    Anonymous Sorry, having trouble following, can you post sample data as text and expected output?


    Not really enough information to go on, please first check if your issue is a common issue listed here: https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882

    Also, please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

    The most important parts are:
    1. Sample data as text, use the table tool in the editing bar
    2. Expected output from sample data
    3. Explanation in words of how to get from 1. to 2.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hello Guys 

     

    just to be clear. I want the output in a table to be like this

     

     

    Greg_Deckler , thanks! I dont know how to send you data example. Im sorry, but I hope you should be able to understand my issue now.

     

     

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hello again

       

      I managed to find out how to make a calculated column for the change of SO art.

       

      Now i just want this formula into a measure.

       

      =IF(OR(Tabel1[PrognoseID]=9002970;Tabel1[PrognoseID]=9003090);SUBSTITUTE(Tabel1[SO art];"ZP01";"ZP0000");[SO art])