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

Data Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more

Reply
Anonymous
Not applicable

SUM only distinct values

Hello,

My table follows this structure:

CODE  DATE           QTD
AA12/12/2020   5
AA12/12/2020   5
AA26/12/2020   8
BB28/12/2020   2
BB31/12/2020   2

I would like to create a measure that makes the sum of distinct values ​​of the QTD column. So for the example above, the sum should be equal to 15 (5+8+2). And if I filtered by CODE=AA in my dashboard, it should be equals to 13 (5+8).

Can someone help me?

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , Try a measure like

sumx(distinct(Table[QTD]), [QTD])

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

View solution in original post

3 REPLIES 3
NJ13
Helper I
Helper I

@amitchandak how about if i want to sum distinct values for QTD based on their codes for the most recent date submitted?

maciek971
New Member

Hi, 
I have a similar issue but based on the example above I'd like to SUM content of column B only once per unique row examined by the content of A column.
2021-05-13_11h02_53.png



amitchandak
Super User
Super User

@Anonymous , Try a measure like

sumx(distinct(Table[QTD]), [QTD])

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
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.