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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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