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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

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
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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
Top Kudoed Authors