Forum Discussion

Moniek's avatar
Moniek
Resolver I
4 years ago
Solved

Missing numbers

Hi,

 

Question..

In a table is column with numbers, I want to know which numbers are missing. Can anyone help me how to find the missing numbers. Thanks!

  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi Moniek ,

     

    Sure. Just use the current row minus the previous row:

    Increasing number = 
    var _preRow= CALCULATE(MAX('Table'[Number]),FILTER(ALL('Table'),[Index]=MAX('Table'[Index])-1))
    return MAX('Table'[Number])- _preRow

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

6 Replies

  • Moniek , Create a new table like

     

    Except(generateseries(Min(Table[Number]), Max(Table[Number])), values(Table[Number]))

    • Moniek's avatar
      Moniek
      Resolver I

      Yeeaaaaah have a nice day!!!!

  • amitchandak thanks, for sure that is a solution for a lot of another issues. But in this case I want to know of the next number increase with 1 is and I want to generate a list of numbers do not increase with 1. Is that possible?

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Moniek ,

     

    Based on this——I want to know of the next number increase with 1 is

    You may firstly add a Index column:

     

    Then create a measure to know if increasing with 1:

    If Increasing 1 = 
    var _preRow= CALCULATE(MAX('Table'[Number]),FILTER(ALL('Table'),[Index]=MAX('Table'[Index])-1))
    return IF( MAX('Table'[Number])-1=_preRow,"Yes","No")

    Output:

     

    And for this——and I want to generate a list of numbers do not increase with 1

    The definition of the third parameter for GENERATESERIES()  is the increment value of the sequence. When not provided, the default value is 1. So you could custom the value:

     

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

    • Moniek's avatar
      Moniek
      Resolver I

      Anonymous Thanks a lot!!! And if you want to see the number of increasing instead yes or no, is that possible?

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Moniek ,

     

    Sure. Just use the current row minus the previous row:

    Increasing number = 
    var _preRow= CALCULATE(MAX('Table'[Number]),FILTER(ALL('Table'),[Index]=MAX('Table'[Index])-1))
    return MAX('Table'[Number])- _preRow

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