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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

Filtering out data based on column entry based on TEXT

Hello,

 

I am looking for the best way to filter out data based on a text entry.  I will provide an example that should help explain what I'm trying to get at.

 

Account          ID          Value          Effective_Date         Transaction_Date

1234               DataA      56              1/1/2018                 5/5/2018

1234               DataB      47              1/1/2018                 6/18/2018

4567               DataB      48              1/1/2018                 7/5/2018

8910               DataA      5                1/1/2018                 12/25/2017

8910               DataB       10              1/1/2018                 6/5/2018

 

I am looking for this output for my dataset

 

Account          ID          Value          Effective_Date         Transaction_Date

1234               DataA      56              1/1/2018                 5/5/2018

4567               DataB      48              1/1/2018                 7/5/2018

8910               DataA      5                1/1/2018                 12/25/2017

 

Basically if there is a DataA value, use that over DataB's value, but if not, then use DataB's for the given account.


Thanks for any potential insight.

1 ACCEPTED SOLUTION
edhans
Super User
Super User

Ok, this is super quick and dirty.

 

See this file.

 

It seems that the Account # and ID are always the same when there is duplication with DataA and DataB, so I grouped on Account#, then took the FIRST value in ID., then merged it with itself.

 

See it in the Power Query window.

 



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

View solution in original post

1 REPLY 1
edhans
Super User
Super User

Ok, this is super quick and dirty.

 

See this file.

 

It seems that the Account # and ID are always the same when there is duplication with DataA and DataB, so I grouped on Account#, then took the FIRST value in ID., then merged it with itself.

 

See it in the Power Query window.

 



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.