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
o59393
Post Prodigy
Post Prodigy

Cómo sumar valores distintos solamente

Hola a todos

Estoy tratando de sumar sólo valores distintos para la columna "unidades" donde la combinación es la misma para mes + código + ciudad

Como se ve por ejemplo:

3432344234cg.JPG

En la imagen de arriba sólo debe sumar 35.661 una vez.

He intentado este dax pero resultado poco éxito:

Sum RE distinct = 

SUMX(
SUMMARIZE(Sheet1,Sheet1[Code],Sheet1[City],Sheet1[Month]),
MAX(Sheet1[Units])
)

El resultado debe ser:

lsadlk2.JPG

https://1drv.ms/u/s!ApgeWwGTKtFdhyxvwe8MeK5wIhZ0?e=CfKDy4

¿Cómo puedo hacerlo bien?

Gracias.

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@o59393, una nueva medida

sumx(summarize(Table,Table[month],Table[code],Table[city],Table[unit]),[unit])

o su fórmula como

Sum RE distinct = 

SUMX(
SUMMARIZE(Sheet1,Sheet1[Code],Sheet1[City],Sheet1[Month],"_1",MAX(Sheet1[Units])),
[_1]
)

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@o59393, una nueva medida

sumx(summarize(Table,Table[month],Table[code],Table[city],Table[unit]),[unit])

o su fórmula como

Sum RE distinct = 

SUMX(
SUMMARIZE(Sheet1,Sheet1[Code],Sheet1[City],Sheet1[Month],"_1",MAX(Sheet1[Units])),
[_1]
)

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.