Forum Discussion

cz1750's avatar
cz1750
Frequent Visitor
8 years ago
Solved

Validating excel source is in numerical order

Hi, I was wondering if it's possible to check items loaded from a excel source to validate that they have been entered in numerical order as expected (1,2,3,4...) I.e set flag to "Error" and col...
  • v-xjiin-msft's avatar
    v-xjiin-msft
    8 years ago

    Hi cz1750,

     

    Sorry for the delay.

     

    Yes, if you got a sequence column, it will be better for the ordering. Please refer to following sample:

     

    The source data in Excel is like:

     

    After loading it into Power BI, it displays as:

    Not the right sequence

     

    Then you can use following calculated column to verify the previous value.

    Previous Value =
    CALCULATE (
        MAX ( Sheet1[id] ),
        FILTER (
            ALL ( Sheet1 ),
            Sheet1[Ordering]
                = EARLIER ( Sheet1[Ordering] ) - 1
                && Sheet1[Grouping] = EARLIER ( Sheet1[Grouping] )
        )
    )

     

    As you can see, even though the ordering is not right. The previous value is still returning the expected result.

     

    Thanks,
    Xi Jin.