cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
newbieuser
Helper I
Helper I

Detect Non-consecutive values in a column

I Have a simple table with one column

S. No.

1

2

3

4

5

7

8

9

 

I want to be able to detect missing values in this column (e.g. in this case 6).

 

Is this possible? Thanks! @amitchandak 

2 ACCEPTED SOLUTIONS
mahoneypat
Super User IV
Super User IV

You can create a virtual table of numbers with GENERATESERIES and then check for missing ones with the EXCEPT function (and then display the table of missing values with CONCATENATEX.  Replace Number[Value] with your actual table/column name.

 

Missing Numbers =
VAR numbersincolumn =
    DISTINCT ( Numbers[Value] )
VAR fulllistofnumbers =
    GENERATESERIES ( 191 )
VAR missingnumbers =
    EXCEPT ( fulllistofnumbersnumbersincolumn )
RETURN
    CONCATENATEX ( missingnumbers, [Value], "," )

 

Pat

 





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


View solution in original post

Hi @newbieuser ,

 

Actually I'm a little confused about your expected output.

In case you want to add the Full number as a column and then combine the original missing column as a new table, you could try this:

 

1. Create a new table:

New table = GENERATESERIES ( MIN('Table'[S.No.]), MAX('Table'[S.No.]), 1 )

2.Use LOOKUPVALUE() to get the matched original column:

original column = LOOKUPVALUE('Table'[S.No.],'Table'[S.No.],[Value])

 

The final output is shown below:

Full and original columns.PNG

 

Best Regards,
Eyelyn Qin
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

5 REPLIES 5
mahoneypat
Super User IV
Super User IV

You can create a virtual table of numbers with GENERATESERIES and then check for missing ones with the EXCEPT function (and then display the table of missing values with CONCATENATEX.  Replace Number[Value] with your actual table/column name.

 

Missing Numbers =
VAR numbersincolumn =
    DISTINCT ( Numbers[Value] )
VAR fulllistofnumbers =
    GENERATESERIES ( 191 )
VAR missingnumbers =
    EXCEPT ( fulllistofnumbersnumbersincolumn )
RETURN
    CONCATENATEX ( missingnumbers, [Value], "," )

 

Pat

 





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


View solution in original post

That works. Thanks! Is there a way to re-route the output to individual values in a new table's column? 

Hi @newbieuser ,

 

Actually I'm a little confused about your expected output.

In case you want to add the Full number as a column and then combine the original missing column as a new table, you could try this:

 

1. Create a new table:

New table = GENERATESERIES ( MIN('Table'[S.No.]), MAX('Table'[S.No.]), 1 )

2.Use LOOKUPVALUE() to get the matched original column:

original column = LOOKUPVALUE('Table'[S.No.],'Table'[S.No.],[Value])

 

The final output is shown below:

Full and original columns.PNG

 

Best Regards,
Eyelyn Qin
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

Great Thanks!

Hi @newbieuser ,

 

Could you please Accept my post as the solution as well if it could help you a little?

Thanks in advance!😀

 

Best Regards,
Eyelyn Qin

Helpful resources

Announcements
PBI_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

MBAS on Demand

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Get Ready for Power BI Dev Camp

Microsoft named a Leader in The Forrester Wave

Microsoft received the highest score of any vendor in both the strategy and current offering categories.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.