Forum Discussion

Chennakesava458's avatar
Chennakesava458
Frequent Visitor
2 years ago
Solved

How to remove duplicates in a measure

Hi Power BI Professionals,       I attached a screenshot below there I wrote a measure called maxlevel for that I want to show value for max date but it is showing for all records how to manage it. ...
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi Chennakesava458 ,

    First create an index column in Power Query Editor, then create a calculated column like below:

    Then the following DAX might work for you:

    Column3 = 
    var _max = CALCULATE(MAX('Table'[index]),FILTER('Table','Table'[maxlevel]=EARLIER('Table'[maxlevel])))
    return
    IF('Table'[index]=_max,'Table'[maxlevel],BLANK())

    The final output is shown in the following figure:

    Best Regards,

    Xianda Tang

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