Forum Discussion

trndlnd's avatar
trndlnd
Frequent Visitor
1 year ago
Solved

Show the latest value based on date column

Hi everyone,   I have a table with a date-column and 5 different categories in their own column. I want a visualization in Power BI (table or card) to show the last value of each category based on ...
  • Anonymous's avatar
    Anonymous
    1 year ago

    Hi, trndlnd 

     

    This problem of yours is better solved in Power Query.

    Choose Date column-Unpivot Other Columns:

    Then:

    In the Power BI Desktop use Dax:

    Measure = 
    Var _lastdate=CALCULATE(MAX('Table'[Date]),FILTER(ALLEXCEPT('Table','Table'[Attribute]),[Value]<>BLANK()))
    RETURN
    CALCULATE(MAX('Table'[Value]),FILTER(ALLEXCEPT('Table','Table'[Attribute]),[Date]=_lastdate))

    Is this the result you expected?

     

    Best Regards,

    Community Support Team _Charlotte

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