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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

how to find missing numbers in an otherwise sequential list

if these are values in a field called ID:   1,2,3,4,5,6,8,9,10,11,12,13,14,16.......

 

How do i develop a way to automatically identify the fact that 7 and 15 are missing

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Depending on the goals it can be done in DAX and Power Query.

 

Here's the PQ version:

  • Load the data into PQ
  • Find the min and the max of that data
  • use that min and max to generate all the values between those two 
  • This is your "Full Table"
  • Generate List.png
  • Duplicate the original query
    • Merge with the full query
    • From Original to Full Table
    • Right Outer
  • Expand the the table
  • You will see Null in the original table column, and what that value is in the new column
  • Tables after merge.png
  • can filter on the null to see what values are missing
  • whats missing.png

 

In DAX I believe you would use GENERATESERIES and pretty much do the exact thing. 

 

PBIX File is here:

https://1drv.ms/f/s!AoQIGRpzoxRHgbxT1CxyVGNGYUXqgQ

View solution in original post

2 REPLIES 2
atlas_nordman
Regular Visitor

Thank you for the elegant solution. However, I went crazy before realizing I had to sort the merged table "Ascending" after the "Full sequence" column.  

Anonymous
Not applicable

Depending on the goals it can be done in DAX and Power Query.

 

Here's the PQ version:

  • Load the data into PQ
  • Find the min and the max of that data
  • use that min and max to generate all the values between those two 
  • This is your "Full Table"
  • Generate List.png
  • Duplicate the original query
    • Merge with the full query
    • From Original to Full Table
    • Right Outer
  • Expand the the table
  • You will see Null in the original table column, and what that value is in the new column
  • Tables after merge.png
  • can filter on the null to see what values are missing
  • whats missing.png

 

In DAX I believe you would use GENERATESERIES and pretty much do the exact thing. 

 

PBIX File is here:

https://1drv.ms/f/s!AoQIGRpzoxRHgbxT1CxyVGNGYUXqgQ

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors