Forum Discussion

i820017's avatar
i820017
Icon for Resolver II rankResolver II
4 years ago
Solved

Column to Measure

The following table is data that I entered in manually.

Is there any way that I can convert the column entitled 'Standard' into a Measure? Normally, I use MAX to do this, but the problem is that when I use MAX in this case, then my Power BI report uses 125 for each month for 'Standard'.

 

 

Would an Switch statement work in this case?

  • Assuming that you have an calendar table in your model, you can create this measure:

    Standard=
    AVERAGEX(
    'Calendar',
    CALCULATE(
    [Days Worked] * SELECTEDVALUE(Tbl[Daily Avg Standard])
    )
    )
     
    Where 'Calendar' should be the name of your calendar table, and Tbl the name of the table where the column Daily Avg Standard is.
     
    It should work has intended:
     
    By day

     

    Or month

     

    Regards,

    Sérgio Silva 

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

6 Replies

  • 'Daily Avg Standard' (or Standard) needs to be multiplied by the 'Days Worked'. However, I cannot do this because 'Days Worked' is a measure and 'Daily Avg Standard' is a column.

     

     

  • Assuming that you have an calendar table in your model, you can create this measure:

    Standard=
    AVERAGEX(
    'Calendar',
    CALCULATE(
    [Days Worked] * SELECTEDVALUE(Tbl[Daily Avg Standard])
    )
    )
     
    Where 'Calendar' should be the name of your calendar table, and Tbl the name of the table where the column Daily Avg Standard is.
     
    It should work has intended:
     
    By day

     

    Or month

     

    Regards,

    Sérgio Silva 

     
    If this post helps, then please consider Accept it as the solution to help the others find it more quickly.
  • Hi,

    How has Standard been calculated?  Share the download link of the PBI file.  Show the expected result.