Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

frequency break (list numbers) How to show gaps greater than +1

Hello experts, I have a small problem with a column with invoice numbers. 
The numbers follow each other. See the picture. Capture2.PNG However, there may be a break in frequency between these bill numbers. Example 1 2 3 (break) 7 8 9 10 11 How to show gaps greater than +1 I would like to be able to display these discrepancies when this happens. Can bi power help me do this?

Thank you very much


Charly

 

1 ACCEPTED SOLUTION
Icey
Community Support
Community Support

Hi @Anonymous ,

Try this:

1. In Power Query Editor, add an Index column.

index.jpg

2. In Report View, create a measure like so:

Is greater than +1 = 
VAR PreviousIndex =
    MAX ( 'Table'[Index] ) - 1
VAR PreviousValue =
    CALCULATE (
        MAX ( 'Table'[Column1] ),
        FILTER ( ALL ( 'Table' ), 'Table'[Index] = PreviousIndex )
    )
VAR Difference =
    MAX ( 'Table'[Column1] ) - PreviousValue
RETURN
    IF ( Difference > 1, 1, 0 )

index2.PNG

 

Best Regards,

Icey

 

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

 

View solution in original post

4 REPLIES 4
Ashish_Mathur
Super User
Super User

Hi,

What exact result are you expecting?


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

hi @Ashish_Mathur ,

I had to identify the breaks in the list for my customer. 

Hi,

Has your problem been solved now?


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Icey
Community Support
Community Support

Hi @Anonymous ,

Try this:

1. In Power Query Editor, add an Index column.

index.jpg

2. In Report View, create a measure like so:

Is greater than +1 = 
VAR PreviousIndex =
    MAX ( 'Table'[Index] ) - 1
VAR PreviousValue =
    CALCULATE (
        MAX ( 'Table'[Column1] ),
        FILTER ( ALL ( 'Table' ), 'Table'[Index] = PreviousIndex )
    )
VAR Difference =
    MAX ( 'Table'[Column1] ) - PreviousValue
RETURN
    IF ( Difference > 1, 1, 0 )

index2.PNG

 

Best Regards,

Icey

 

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

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.