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
samnaw
Resolver I
Resolver I

Distinct add columns

Hi 

 

I want to do this:

 

 

SELECT Distinct(column1), column2
FROM table1
WHERE column2 is not null

 

 

I know how to do distinct:

 

FILTER(DISTINCT('DASHBOARD'[CYM_Name]), NOT ISBLANK ( 'DASHBOARD'[CYM_Name]))

 

 

I know how to do summarize column:

 

SUMMARIZE(FILTER('DASHBOARD', NOT ISBLANK ( 'DASHBOARD'[CYM_Name]))
,'DASHBOARD'[SYW],'DASHBOARD'[CYM_Name])

 

 

But I want to use DISTINCT instead of summarize. Is that possible? or is summarize the only way you can distinct and then bring another column. 

1 ACCEPTED SOLUTION
v-lionel-msft
Community Support
Community Support

Hi @samnaw ,

 

My sample data table.

Column1Column2

A x1
A x2
A  
B x3
B x4
C x5
D  
D  

 

In Database

 

v-lionel-msft_1-1608273394947.png

In Power BI Desktop

v-lionel-msft_2-1608274237319.png
If it's not right, please show me the sample data and expected output. 

It should be possible to use the DISTINCT() function, but your [Column2] has no aggregation, which confuses me.

 

Best regards,
Lionel Chen

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

2 REPLIES 2
v-lionel-msft
Community Support
Community Support

Hi @samnaw ,

 

My sample data table.

Column1Column2

A x1
A x2
A  
B x3
B x4
C x5
D  
D  

 

In Database

 

v-lionel-msft_1-1608273394947.png

In Power BI Desktop

v-lionel-msft_2-1608274237319.png
If it's not right, please show me the sample data and expected output. 

It should be possible to use the DISTINCT() function, but your [Column2] has no aggregation, which confuses me.

 

Best regards,
Lionel Chen

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

 

 

amitchandak
Super User
Super User

@samnaw , Try like

summarize(filter(Table, not(isblank(Table[column2]))), Table[column1],Table[column2])

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
Top Kudoed Authors