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
Anonymous
Not applicable

Eliminar duplicados en DAX

Hola, chicos

Tengo dos tablas diferentes, la tabla de hechos (muchos identificadores) y mi tabla de tiempo (identificador único)

Mi resultado después de mi medida dax es así: (MY DAX MEASURE está contando identificadores únicos en la tabla de hechos)

HoraIdContar
Mañana130
Tarde130
Afternon250
Noche350

Necesito esto:

HoraIdContar
Mañana130
Tarde250
Noche350

Básicamente necesito tomar sólo el primer valor para id 1, que sería por la mañana y no por la tarde

Mi problema es cuando combino ambas tablas porque un ID puede tener varios IDS en la tabla de tiempo

Necesito usar dax medida calculada para esto, ¿es esto posible?

Gracias de antemano

1 ACCEPTED SOLUTION

Hola

Puede descargar mi archivo PBI desde aquí.

Espero que esto ayude.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

7 REPLIES 7
danextian
Super User
Super User

hI @fabnishi1207 ,
Puede probar esta fórmula para ser utilizada como un filtro visual donde el valor 1

FirstValue =
IF (
    SELECTEDVALUE ( 'FACT'[start time] )
        = CALCULATE ( MIN ( 'FACT'[start time] ), ALLEXCEPT ( 'FACT', 'FACT'[ID] ) ),
    1,
    0
)










Did I answer your question? Mark my post as a solution!


Proud to be a Super User!









"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.
Anonymous
Not applicable

¡Acabo de proporcionar más detalles!

¡Gracias!

Hola

Puede descargar mi archivo PBI desde aquí.

Espero que esto ayude.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Ashish_Mathur
Super User
Super User

Hola

Comparta las tablas de datos base desde donde creó esta salida.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
vivran22
Community Champion
Community Champion

Hola @fabnishi1207 ,

La salida requerida no está clara de su descripción. Por favor, comparta más detalles sobre la salida.

¡Salud!
Vivek

Blog: vivran.in/my-blog
Conectarse en LinkedIn
Seguir en Twitter

edhans
Super User
Super User

Es posible, pero no la forma en que tiene sus datos. Si utilizo la función MIN(), obtengo esto:

edhans_0-1601599829671.png

MAX() habría devuelto Morning para ID1, pero el problema es que Power BI no sabe qué son "Mañana" y "Tarde". En su lugar, MIN/MAX están trabajando alfabéticamente aquí.

Y dado que sus datos no son alfabéticos, MIN/MAX no funcionará. Por ejemplo, MIN regresa por la tarde en este ejemplo, pero si tuviera mañana y noche para algunos IDs, MIN volvería Por la noche porque E es anterior a M. Necesita otro campo para definir el orden para tomar sus datos y tirar de eso. O convertir la mañana, la tarde, la noche en 8 a. m. a 12 del mediodía, las 6 p. m. como campo de tiempo. Entonces MIN/MAX funcionaría bien.



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting
danextian
Super User
Super User

hI @fabnishi1207 ,

¿La tabla indica qué valor de la columna Time es el primero para cada ID? Puede crear una fórmula que devuelva solo el valor de Morning, pero Morning puede no ser siempre el primer valor.










Did I answer your question? Mark my post as a solution!


Proud to be a Super User!









"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

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.