Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago
Solved

URGENT!! Convert Measure to Calculated Column

Hello Power BI community!   Need some urgent help in converting the following measure to a calculated column. The min purpose is that I can use this new column as a legend for my pie chart.    Ra...
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi, Anonymous 

    Thank you very much for your reply. Here's how I handle ranking with measure in calculated columns:
    1. First of all, use the summarize function to summarize the measure, here I simply create a measure as shown in the following photos:

    I use the following DAX to call this measure and generate a calculation table:

    Table =
    SUMMARIZE (
        'df_Search Order (First)',
        'df_Search Order (First)'[Search Order (First)],
        "result", [category_Occasion_%]
    )
    

    Here are the results:

    You need to replace [category_Occasion_%] with your measure.

    2. Create a connection for the two tables:

    3.The following DAX is used for ranking in the original table:

    Ranking SingleSelect =
    RANKX ( 'df_Search Order (First)', RELATED ( 'Table'[result] ),, DESC, SKIP )

    Here are the results: