Forum Discussion

Sarencibia's avatar
Sarencibia
Frequent Visitor
4 years ago
Solved

Change a Measure into a Column

Dear community,

 

I really hope you are able to help me solve this problem.

 

I have a Measure:

 

Measure=

Var a=
MAXX(
FILTER(ALL(Table),Table[Column1]= SELECTEDVALUE(Table[Column1]) ),
Table[Column2]
)
Var b=
MAXX(
FILTER(
ALL(Table),
Table[Column1]= SELECTEDVALUE(Table[Column1])
&& Table[Column2]= a
),
Table[Column3]
)
RETURN
b

 

And I need to modify it into a column. This is possible?

Somebody could help me? Thanks!

  • You can always convert from measure to calculated column (and lose the interactivity)

     

    Please provide sanitized sample data that fully covers your issue. I cannot help you without usable sample data.
    Please paste the data into a table in your post or use one of the file services like OneDrive or Google Drive. I cannot use screenshots of your source data.
    Please show the expected outcome based on the sample data you provided. Screenshots of the expected outcome are ok.

    https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523

  • Hi Sarencibia ,

     

    Try below formula:

    M_ = SELECTEDVALUE('Table'[Column2])
    Col_ =
    VAR a =
        MAXX ( FILTER ( ALL ( 'Table' ), 'Table'[Column2] = [M_] ), 'Table'[Column3] )
    VAR b =
        MAXX (
            FILTER ( ALL ( 'Table' ), 'Table'[Column2] = [M_] && 'Table'[Column3] = a ),
            'Table'[Column3]
        )
    RETURN
        b

     

    Here is measure formula:

    M =
    VAR sel =
        SELECTEDVALUE ( 'Table'[Column2] )
    VAR a =
        MAXX ( FILTER ( ALL ( 'Table' ), 'Table'[Column2] = sel ), 'Table'[Column3] )
    VAR b =
        MAXX (
            FILTER ( ALL ( 'Table' ), 'Table'[Column2] = sel && 'Table'[Column3] = a ),
            'Table'[Column3]
        )
    RETURN
        b

    If the problem is still not resolved, please provide detailed error information and test data. 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.

2 Replies

  • v-henryk-mstf's avatar
    v-henryk-mstf
    Community Support

    Hi Sarencibia ,

     

    Try below formula:

    M_ = SELECTEDVALUE('Table'[Column2])
    Col_ =
    VAR a =
        MAXX ( FILTER ( ALL ( 'Table' ), 'Table'[Column2] = [M_] ), 'Table'[Column3] )
    VAR b =
        MAXX (
            FILTER ( ALL ( 'Table' ), 'Table'[Column2] = [M_] && 'Table'[Column3] = a ),
            'Table'[Column3]
        )
    RETURN
        b

     

    Here is measure formula:

    M =
    VAR sel =
        SELECTEDVALUE ( 'Table'[Column2] )
    VAR a =
        MAXX ( FILTER ( ALL ( 'Table' ), 'Table'[Column2] = sel ), 'Table'[Column3] )
    VAR b =
        MAXX (
            FILTER ( ALL ( 'Table' ), 'Table'[Column2] = sel && 'Table'[Column3] = a ),
            'Table'[Column3]
        )
    RETURN
        b

    If the problem is still not resolved, please provide detailed error information and test data. 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.

  • You can always convert from measure to calculated column (and lose the interactivity)

     

    Please provide sanitized sample data that fully covers your issue. I cannot help you without usable sample data.
    Please paste the data into a table in your post or use one of the file services like OneDrive or Google Drive. I cannot use screenshots of your source data.
    Please show the expected outcome based on the sample data you provided. Screenshots of the expected outcome are ok.

    https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523