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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Anonymous
Not applicable

IF-CALCULATE

Hola a todos,

Quiero filtrar con calificación según abajo

Total de Ventas < 8000 a 1

Total de Ventas 8000 a 10000 a 2

Total de Ventas > 10000 a 3

He creado una nueva columna con filtro follwing y no está funcionando.

------------

IF( CALCULATE(SUM(Trans[Price.PRICE]),ALLEXCEPT(Trans,Trans[CUSTNUM1])< 8000 , "1",
SI(
CALCULATE(SUM(Trans[Price.PRICE]),ALLEXCEPT(Trans,Trans[CUSTNUM1])) >8000 && <10000, "2",
SI(
CALCULATE(SUM(Trans[Price.PRICE]),ALLEXCEPT(Trans,Trans[CUSTNUM1]))<-10000,"3"
)
)
))
--------------------------
Gracias de antemano por su respuesta.
5 REPLIES 5
BIReel
Frequent Visitor

Measure =
VAR FilteredPrice =
    CALCULATE ( SUM ( Trans[Price.PRICE] ), ALLEXCEPT ( Trans, Trans[CUSTNUM1] ) )
RETURN
    SWITCH (
        TRUE (),
        FilteredPrice < 8000, "1",
        FilteredPrice > 8000
            && FilteredPrice < 10000, "2",
        // default case
        "3"
    )


Christopher Pollock - LinkedIn

Si este post ayuda por favor considere "Aceptarlo como la solución" para ayudar a los otros miembros a encontrarlo más rápidamente.

Vist nosotros en https://www.bireel.com/ para cursos, desarrollo y propósitos de consultoría

amitchandak
Super User
Super User

@SWEZIN , ver que está buscando para la segmentación, consulte

https://www.daxpatterns.com/dynamic-segmentation/
https://www.daxpatterns.com/static-segmentation/
https://www.poweredsolutions.co/2020/01/11/dax-vs-power-query-static-segmentation-in-power-bi-dax-po...
https://radacad.com/grouping-and-binning-step-towards-better-data-visualization

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here
harshnathani
Community Champion
Community Champion

HOLA @SWEZIN ,

Prueba esta medida

Medidas ?

var a - CALCULATE(SUM(Trans[Price.PRICE]),ALLEXCEPT(Trans,Trans[CUSTNUM1]

devolución

SWITCH(

TRUE(),

a >-10000, "3",

a <10000 && a > 8000 ,"2",

"1"

)

saludos

Harsh Nathani

¿He respondido a tu pregunta? ¡Marca mi puesto como una solución! Apreciar con un Kudos!! (Haga clic en el botón Pulgares arriba)

az38
Community Champion
Community Champion

Hola @SWEZIN

probar SWITCH()

Measure = 
var _SumPrice = CALCULATE(SUM(Trans[Price.PRICE]),ALLEXCEPT(Trans,Trans[CUSTNUM1]) )

RETURN
SWITCH(TRUE(),
_SumPrice  < 8000 , "1",
_SumPrice  > 8000 && _SumPrice < 10000, "2",
"3"
)

do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn
kentyler
Solution Sage
Solution Sage

Cuando dices "y no está funcionando", ¿qué está haciendo?

Podría considerar la posibilidad de crear una "medida auxiliar"

Calc_Total: CALCULATE(SUM(Trans[Price.PRICE]),ALLEXCEPT(Trans,Trans[CUSTNUM1])

y pon eso en tu mesa y mira si está devolviendo las respuestas que esperas.

Si es así, puede usarlo para calcular la columna.
Si está interesado en convertir sus 3 categorías en una segmentación de datos, puede usar el patrón "tabla de parámetros" https://www.daxpatterns.com/parameter-table/





Did this post answer your question? Mark it as a solution so others can find it!

Help when you know. Ask when you don't!




Join the conversation at We Talk BI find out more about me at Slow BI


Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.

Top Solution Authors
Top Kudoed Authors