Forum Discussion

extrasiyf's avatar
extrasiyf
Frequent Visitor
6 years ago
Solved

Get the latest non blank value

Hello, I have a request on Power BI Desktop, I want to have a YTD result, which takes the value of the last month not blank. For example in this example have as result YTD 129. Here is the example...
  • Anonymous's avatar
    Anonymous
    6 years ago

    Hi extrasiyf ,

     

    Try this:

    YTD =
    SWITCH (
        TRUE (),
        'Table'[Dec] <> 0, 'Table'[Dec],
        'Table'[Nov] <> 0, 'Table'[Nov],
        'Table'[Oc] <> 0, 'Table'[Oc],
        'Table'[Sep] <> 0, 'Table'[Sep],
        'Table'[Aug] <> 0, 'Table'[Aug],
        'Table'[Juil] <> 0, 'Table'[Juil],
        'Table'[Jui] <> 0, 'Table'[Jui],
        'Table'[May] <> 0, 'Table'[May],
        'Table'[Mar] <> 0, 'Table'[Mar],
        'Table'[Feb] <> 0, 'Table'[Feb],
        'Table'[Jun] <> 0, 'Table'[Jun]
    )
    

     

    Best Regards,

    Jay

     

    Community Support Team _ Jay Wang

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