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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
venkatt
Regular Visitor

how to select distinct values from a table

Dear Community, 

I have following scenario and appreciate your support.

Table : XXXXX

 Sales order    description    LastChangeDate

0001            sales order1     01.08.2020

0002            sales order2     02.08.2020

0001            sales order1     12.07.2020

0002            sales order2     05.06.2020

 

I would like to select discting  Sales orders ,descriptions  and the latest "LastChangedDate". 

 Sales order    description    LastChangeDate

example expected results:

 Sales order    description    LastChangeDate

0001            sales order1     01.08.2020

0002            sales order2     02.08.2020

 

Appriciate your solution .

Best Regards.

Ramana

5 REPLIES 5
amitchandak
Super User
Super User

@venkatt , Try like

 

description = lastnonblankvalue(Table[LastChangeDate],max(Table[description]))

// Add this desc and rest two as same

OR

//or this measure in place of date

Measure =
VAR __id = MAX ( 'Table'[ Sales order ] )
VAR __date = CALCULATE ( MAX( 'Table'[LastChangeDate] ), ALLSELECTED ( 'Table' ), 'Table'[ Sales order ] = __id )
RETURN CALCULATE ( Max ( 'Table'[LastChangeDate] ), VALUES ( 'Table'[ Sales order ), 'Table'[ Sales order] = __id, 'Table'[LastChangeDate] = __date )

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

HI Amit ,

 

Thank you for the reply. Is it possible to create new table using dax and achive only the distinct values of sales orders along with only LastChangedDate.

Thanks in advance.

Anonymous
Not applicable

Might seem like a simple solution, however, are you able to use a slicer or are you looking for a Dax specific solution? 
Try dragging the LastChangeDate into the slicer and visuals on your report will adjust to show the corresponding values. 

Karlos_0-1596403917012.png

 



Hi Carlos, 

 

Thank you for the reply, i am looking for Dax solution , so that i can list the distint values into separate table and visualize only unique values. 

 

Thanks,

Ramana

 

az38
Community Champion
Community Champion

@venkatt 

just put all your columns into visual table and set aggregation for date value as Last:

Безымянный.png


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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