Forum Discussion

PaulTHR's avatar
PaulTHR
Frequent Visitor
4 years ago
Solved

To obtain first value (or non null) in a data row - reading left to right

Hi - I need to get the first non null value from a given row (reading left to right) in a table that can be used further in a calculation. I can find info on first non null in a column but cannot see how to do in a row - example below - any suggestions?

01/07/2021  

 

01/08/2021  

 

01/09/2021  

 

01/10/2021  

 

01/11/2021  

 

FIRST IN ROW VALUE
   250300250
 150200250300150
100150200250300100
    300300

4 Replies

  • Vijay_A_Verma's avatar
    Vijay_A_Verma
    Icon for Most Valuable Professional rankMost Valuable Professional

    Use below formula

    = List.RemoveNulls(Record.ToList(_)){0}
    • PaulTHR's avatar
      PaulTHR
      Frequent Visitor

      Worked first time thanks very much!

  • Greg_Deckler's avatar
    Greg_Deckler
    Icon for Community Champion rankCommunity Champion

    PaulTHR I would add an Index and then unpivot your columns. Then it should be trivial. Could always pivot back if needed.

    • PaulTHR's avatar
      PaulTHR
      Frequent Visitor

      Thanks for your help used a different solution but thanks again.