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
paul_jones
Frequent Visitor

Only display if occurs more than once

This seems simple but...  I only  want to display serial number and date if the serial number occurs more than once.

Serial NumberDate
1013/1/2022
1023/1/2022
1033/1/2022
1034/5/2022
1045/1/2022
1054/7/2022
1055/1/2022
1063/15/2022

 

Resulting table would be:

Serial NumberDate
1033/1/2022
1034/5/2022
1054/7/2022
1055/1/2022
1 ACCEPTED SOLUTION
Shaurya
Memorable Member
Memorable Member

Hi @paul_jones,

 

You can use this DAX formula:

 

New Table = FILTER('Table',COUNTX('Table',IF('Table'[Serial Number]=EARLIER('Table'[Serial Number]),'Table'[Serial Number]))>1)

 

Works for you? Mark this post as a solution if it does!
Consider taking a look at my blog: Forecast Period - Previous Forecasts

View solution in original post

2 REPLIES 2
Shaurya
Memorable Member
Memorable Member

Hi @paul_jones,

 

You can use this DAX formula:

 

New Table = FILTER('Table',COUNTX('Table',IF('Table'[Serial Number]=EARLIER('Table'[Serial Number]),'Table'[Serial Number]))>1)

 

Works for you? Mark this post as a solution if it does!
Consider taking a look at my blog: Forecast Period - Previous Forecasts

mangaus1111
Solution Sage
Solution Sage

Hi @paul_jones ,

 

first you have to create a calculated column:

 

@Count = COUNTROWS(
                FILTER(
                    'Table',
                    'Table'[Serial Number] = EARLIER('Table'[Serial Number])
                    )
            )
 
Then you can create your new table:
 
New Table =
SELECTCOLUMNS(
               CALCULATETABLE(
                              'Table',
                              'Table'[@Count]>1
                              ),
                "Serial Number", 'Table'[Serial Number],
                "Date", 'Table'[Date]
                )
 
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.