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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.