Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago

Measures into Columns

Hi everyone! I have two mesures Total Depth and Total Time. Since I can't plot them in one line chart ( Depth vs Time where Time is on the X-axis), I need to convert these measures into columns. How do I do it?
 
Total depth = ((
var _stepno = SELECTEDVALUE('DM_WELL_PLAN_OP'[step_no])
return
IF(
_stepno=1,
SELECTEDVALUE('DM_WELL_PLAN_OP'[md_from]),
LOOKUPVALUE('DM_WELL_PLAN_OP'[md_to],'DM_WELL_PLAN_OP'[step_no],_stepno-1)
))+SUM(CD_DATUM[datum_elevation]))*(-1)*0.3048
 
Total time = (CALCULATE(SUM('DM_WELL_PLAN_OP'[target_duration]),FILTER(ALL('DM_WELL_PLAN_OP'),'DM_WELL_PLAN_OP'[step_no]<MAX('DM_WELL_PLAN_OP'[step_no])))+0)/24

6 Replies

  • mwegener's avatar
    mwegener
    Most Valuable Professional

    Hi Anonymous ,
    I would say that is not possible.
    Columns are static and measures are dynamic.
    If the dynamic is to be preserved, this is not possible.

    Otherwise you can create a corresponding calculated table if necessary.

     

  • v-kelly-msft's avatar
    v-kelly-msft
    Community Support

    Hi Anonymous ,

     

    Once converted to columns,you will get fixed values,which wont be changed by your parameter.

    Try below expressions:

    Total depth = (( 
    var _stepno = 'DM_WELL_PLAN_OP'[step_no]
    return
    IF(
    _stepno=1,
    'DM_WELL_PLAN_OP'[md_from],
    LOOKUPVALUE('DM_WELL_PLAN_OP'[md_to],'DM_WELL_PLAN_OP'[step_no],_stepno-1)
    ))+CD_DATUM[datum_elevation]*(-1)*0.3048
     
    Total time = (CALCULATE(SUM('DM_WELL_PLAN_OP'[target_duration]),FILTER('DM_WELL_PLAN_OP','DM_WELL_PLAN_OP'[step_no]<EARLIER('DM_WELL_PLAN_OP'[step_no])))+0)/24
    Best Regards,
    Kelly
    Did I answer your question? Mark my post as a solution!

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi v-kelly-msft many thanks! I've used the expression for creating a new column called Total time, but its values are higher than in the measure by constant 0.04. Any idea where is this difference coming from?

      • v-kelly-msft's avatar
        v-kelly-msft
        Community Support

        Hi Anonymous ,

         

        Could you pls provide  me some raw data in editable format to test?

         

        Best Regards,
        Kelly
        Did I answer your question? Mark my post as a solution!