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

Need help to filter the records for the same name and different locations.

Hello community, Need help
   from below table need to filter the records for the same name and different locations. please help me thanks.

sample data:

NameLocationDate
saihyd7/10/2023
saiBangalore7/5/2023
keerthihyd7/1/2023
adihyd7/2/2023
surekhahyd7/3/2023
surihyd7/4/2023
surihyd6/10/2023
charanhyd6/11/2023
charanchennai6/12/2023


Expected Output:
---------------

NameLocationDate
saihyd7/10/2023
saiBangalore7/5/2023
charanhyd6/11/2023
charanchennai6/12/2023
1 ACCEPTED SOLUTION

Hi @Saichebrolu , I think that the solution I posted earlier works, including the new requirement.

Creating the same column:

column = countrows(filter(tabla,
Tabla[Name] = EARLIER(Tabla[Name]) &&
Tabla[Location] <> EARLIER(Tabla[Location])))
And then you have to filter when this column is not blank.
 
mcaraballo_0-1691067458679.png

 

View solution in original post

10 REPLIES 10
mcaraballo
Advocate III
Advocate III

HI!

Using this sample data, I created the same table and then I just added this calculated column. 

mcaraballo_0-1691063633643.png

 

mcaraballo_1-1691063669071.png

Then, you just need to filter when column = 1, and you will get the output you need!

mcaraballo_2-1691063715746.png

 

Hope this helps you!
Regards,
Mariano.

DID I ANSWER YOUR QUESTION? PLEASE MARK MY POST AS A SOLUTION! APPRECIATE YOUR KUDO!

Semaj06
Regular Visitor

Hi

 

Not sure to understand you at 100%. I made this. Hope it can help.

Filter the new column in 1

Semaj06_0-1691060794071.png

colonne =
IF (
Feuil1[Colonne] = 1,
1,
IF (
CALCULATE (
MAXX ( Feuil1, Feuil1[Date] ),
ALLEXCEPT ( Feuil1, Feuil1[Name], Feuil1[Location] )
) = Feuil1[Date],
1,
0
)
)

olgad
Super User
Super User

Dear @Saichebrolu, apologies, dont quite follow you. Do I understand you right, that you dont want suri hyd combination in your list?
if so, then create a concat column of name and location
and then this calc

Column = If(Calculate(Count('Table'[Concat]), ALLEXCEPT('Table','Table'[Concat]))=2,false,if( Calculate(Count('Table'[Name]), ALLEXCEPT('Table','Table'[Name]))=2, true, false))
olgad_0-1691060187503.png

 

 




DID I ANSWER YOUR QUESTION? PLEASE MARK MY POST AS A SOLUTION! APPRECIATE YOUR KUDO/LIKE!
PROUD TO BE A SUPER USER!
Best Stories, Interesting Cases: PowerBI Storytime Newsletter
Linkedin Profile: Linkedin
YouTube Channel: PowerBI Storytime

@olgad 
Sorry for the inconviniance.Yeah it's almost working. but my requirment has got enhanced.
We need to filter the all duplicate names along with morethan one location.
Note: We can have duplicate locations with in a single name(if we have more than one locations)

data table:

NameLocationDate
saihyd7/10/2023
saiBangalore7/5/2023
saihyd7/11/2023
keerthihyd7/1/2023
adihyd7/2/2023
surekhahyd7/3/2023
surihyd7/4/2023
surihyd6/10/2023
charanhyd6/11/2023
charanchennai6/12/2023
charancennai6/3/2023


Expected Output:

Name Location                   Date
sai hyd7/10/2023
sai Bangalore7/5/2023
sai hyd7/11/2023
charan hyd6/11/2023
charan chennai6/12/2023
charan cennai6/3/2023

Hi @Saichebrolu , I think that the solution I posted earlier works, including the new requirement.

Creating the same column:

column = countrows(filter(tabla,
Tabla[Name] = EARLIER(Tabla[Name]) &&
Tabla[Location] <> EARLIER(Tabla[Location])))
And then you have to filter when this column is not blank.
 
mcaraballo_0-1691067458679.png

 

Hi @mcaraballo i got aa one more enhancement in the requirment. need help.
Conditions:

-------------------

1.Need to filter records for createdDate last 30 days.
&&

2.Name should have more than one location.
Note: 8/4/2023 is the current date.
Sample Data
---------------

NameLocationCreated Date
saihyd8/4/2023
saiBangalore7/6/2023
saihyd7/11/2023
keerthihyd7/1/2023
adihyd7/2/2023
surekhahyd7/3/2023
surihyd8/4/2023
surihyd8/1/2023
charanhyd8/4/2023
charanchennai6/12/2023
charanchennai6/3/2023
Ravihyd8/4/2023
RaviBangalore5/6/2023
Ravihyd7/11/2023


Expected Output
-----------------------

saihyd8/4/2023
saiBangalore7/6/2023
saihyd7/11/2023

Hi @Saichebrolu ,

 

for some reason I was not able to make it work in the same column/table (I thought that with a littler change it was going to work). To ge the expected output I had to:

1st step: create a new table with the <= 30 days filter, based on the first table I told you in previous message.

mcaraballo_1-1691152492505.png

2nd step: create this column:

Column2 = countrows(filter('table2', 'table2'[Name] = EARLIER('table2'[Name]) && 'table2'[Location] <> EARLIER('table2'[Location]) && 'table2'[column] >= 1 ))
mcaraballo_2-1691152608513.png

then, filter when this "column2" is not blank.

 

I think this will work.

Regards,

Mariano.

PS: please, visit this idea and vote it if you like it ! Ability to show/hide any object based on a conditi... - Microsoft Fabric Community

 

DID I ANSWER YOUR QUESTION? PLEASE MARK MY POST AS A SOLUTION! APPRECIATE YOUR KUDO!

Hi @Saichebrolu did it work ? 

 

Regards,

Mariano.

PS: please, visit this idea and vote it if you like it ! Ability to show/hide any object based on a conditi... - Microsoft Fabric Community

 

DID I ANSWER YOUR QUESTION? PLEASE MARK MY POST AS A SOLUTION! APPRECIATE YOUR KUDO!

olgad
Super User
Super User

Hi, create a calculated column to see the duplicates 

Column = Calculate(Count('Table'[Name]), ALLEXCEPT('Table','Table'[Name]))
 
Then filter the visual for the value of 2. 

olgad_0-1691057795241.png

 


DID I ANSWER YOUR QUESTION? PLEASE MARK MY POST AS A SOLUTION! APPRECIATE YOUR KUDO/LIKE!
PROUD TO BE A SUPER USER!
Best Stories, Interesting Cases: PowerBI Storytime Newsletter
Linkedin Profile: Linkedin
YouTube Channel: PowerBI Storytime

@olgad

PREVIEW
Thanks for your reply but from above calculation i will get below output right.

Name= "suri" belongs to single location that is "hyd"
we should get duplicate names with different locations data.

NameLocationDate
saihyd7/10/2023
saiBangalore7/5/2023
charanhyd6/11/2023
charanchennai6/12/2023
surihyd7/4/2023
surihyd6/10/2023

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.