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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

DAX for comparing rows

Hi Community,

 

Following is a snippet of my sample dataset:

ExcelPBI_0-1626944238682.png

I want to compare Apnt date rows and apnt type rows combination. If there is a match then only distinct values are considered in the resultset.

So, with the right calculated column, the result would look like this:

ExcelPBI_1-1626944481202.png

 

Many thanks in advance!

 

 

1 ACCEPTED SOLUTION
v-xiaotang
Community Support
Community Support

Hi @Anonymous 

Have you solved this problem?

-

if not, you need to add an index column in your table firstly, or fill the table like bellow, 

vxiaotang_0-1627366351926.png

then, here are 2 ways to remove duplicate rows,

(1) in PQ editor

vxiaotang_1-1627368477169.png

(2) use DAX

TableTest2 = DISTINCT(TableTest1)

vxiaotang_2-1627368560395.png

 

Note: the duplicate rows won't be removed unless you already have an existing way to order them such as an index column added in Power Query or a primary key from a db. 

 

Any question, please let me know. Looking forward to receiving your reply.

 

Best Regards,

Community Support Team _Tang

If this post helps, please consider Accept it as the solution to help the other members find it more quickly.

 

 

View solution in original post

5 REPLIES 5
v-xiaotang
Community Support
Community Support

Hi @Anonymous 

Have you solved this problem? If yes, could you kindly accept the answer helpful as the solution (or kindly share your solution ). so the others can find it more quickly.

Regards,

Community Support Team _Tang

v-xiaotang
Community Support
Community Support

Hi @Anonymous 

Have you solved this problem?

-

if not, you need to add an index column in your table firstly, or fill the table like bellow, 

vxiaotang_0-1627366351926.png

then, here are 2 ways to remove duplicate rows,

(1) in PQ editor

vxiaotang_1-1627368477169.png

(2) use DAX

TableTest2 = DISTINCT(TableTest1)

vxiaotang_2-1627368560395.png

 

Note: the duplicate rows won't be removed unless you already have an existing way to order them such as an index column added in Power Query or a primary key from a db. 

 

Any question, please let me know. Looking forward to receiving your reply.

 

Best Regards,

Community Support Team _Tang

If this post helps, please consider Accept it as the solution to help the other members find it more quickly.

 

 

amitchandak
Super User
Super User

@Anonymous , Power bi by default shows distinct values only. Values will not repeat, unless you have unique column

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

@amitchandak it is data quality issue with my dataset. Power BI doesnt show unique values in this case.

@Anonymous , Create a table with distinct or delete duplicates in power query

 

Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

 

 

New table = Distinct(Table)

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors