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
Giada_Togliatti
Post Patron
Post Patron

Función en DAX

Hola

¿Hay alguna función en el lenguaje dax que es algo así en el sentido qlik?

Only - función de gráfico

Only() devuelve un valor si hay un único resultado posible de los datos agregados. Por ejemplo, la búsqueda del único producto en el que el precio unitario 9 devolverá NULL si más de un producto tiene un precio unitario de 9.

Gracias

3 REPLIES 3
v-xuding-msft
Community Support
Community Support

Hola @Giada_Togliatti ,

Como sugieren los superusuarios anteriores, puede utilizar la función MAX() para devolver un valor. Para su ejemplo, podría hacer referencia al ejemplo siguiente para probarlo.

Measure =
VAR count9 =
    CALCULATE (
        COUNTROWS ( 'Table' ),
        FILTER ( ALLEXCEPT ( 'Table', 'Table'[Category] ), 'Table'[Unit price] = 9 )
    )
VAR onlyProduct =
    CALCULATE (
        MAX ( 'Table'[Product] ),
        FILTER ( 'Table', 'Table'[Unit price] = 9 && count9 = 1 )
    )
RETURN
    IF ( count9 = 1, onlyProduct )

v-xuding-msft_0-1595319745811.png

Si esto no puede ayudarle, comparta algunos datos de muestra y la salida esperada. Lo entenderemos claramente y lo resolveremos rápidamente.

Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
amitchandak
Super User
Super User

@Giada_Togliatti, algo así

if(countx(filter(summarize(table, table[product], "_1",calculate(countrows(Table),table[Price]-9)),[_1]>-1),[producto])-1,"True",null)

Tahreem24
Super User
Super User

@Giada_Togliatti ,

Supongo que MAX() puede ayudarte.
Por favor, comparta los pequeños datos de muestra junto con el resultado esperado para que ayude a relacionados con DAX.

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard

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.