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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
vikrammankar
Frequent Visitor

How to get distinct or unique value from a table using a measure

Hi,

 

I have below table 

 

T

ENAMESNAMENOWD
JohnAlex20
JohnAlex20
JohnAlex20

 

In Microsoft Access when I write query SELECT DISTINCT(NOWD), sname FROM T;

I get below output:

NOWDSNAME
20Alex

 

How do I do the same in Power BI by writing a measure

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

Hi @vikrammankar ,

 

I suggest you to create a table visual by "Don't summarize" function in [NOWD] column in Value Field.

My Sample:

RicoZhou_0-1653446914180.png

Result is as below.

RicoZhou_1-1653446936975.png

Or you can create a calculated table with distinct (NOWD and SNAME).

Distinct Table = 
SUMMARIZE('Table','Table'[SNAME],'Table'[NOWD])

Result is as below.

RicoZhou_2-1653447030174.png

 

Best Regards,

Rico Zhou

 

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-rzhou-msft
Community Support
Community Support

Hi @vikrammankar ,

 

I suggest you to create a table visual by "Don't summarize" function in [NOWD] column in Value Field.

My Sample:

RicoZhou_0-1653446914180.png

Result is as below.

RicoZhou_1-1653446936975.png

Or you can create a calculated table with distinct (NOWD and SNAME).

Distinct Table = 
SUMMARIZE('Table','Table'[SNAME],'Table'[NOWD])

Result is as below.

RicoZhou_2-1653447030174.png

 

Best Regards,

Rico Zhou

 

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

jcalheir
Solution Supplier
Solution Supplier

Hi

 

In DAX you have the similar function DISTINCT

 

Please check this microsoft article bellow to see some examples.

https://docs.microsoft.com/pt-pt/dax/distinct-table-function-dax

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.