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

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

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