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

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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