Forum Discussion

rod_puente's avatar
rod_puente
Helper I
10 months ago
Solved

Calculation affected by segment month

Dear All

 

Pls your help, I have a table in PBI Desktop, but it is not taking into account the month segment. I have applied the month of January and the table with calculate continues showing me Feb, Mar, etc., when the correct thing would be to show values ​​in 0.

 

  

 

I used the CALCULATE function:

Cantidad Facturada Enero =
CALCULATE( SUM('Detalle Facturacion'[Cantidad Facturada]), 'Detalle Facturacion'[Mes Nombre]= "Ene" )

 

What would the function need to calculate based on the applied month segment? Or what would be the correct function?

 

 

Regards

Rodrigo P.

 

  • Hi,

    I am not sure how your semantic model looks like, but please try something like below whether it works.

     

    KEEPFILTERS DAX FUNCTION Microsoft Learn 

     

    Cantidad Facturada Enero =
    CALCULATE (
        SUM ( 'Detalle Facturacion'[Cantidad Facturada] ),
        KEEPFILTERS ( 'Detalle Facturacion'[Mes Nombre] = "Ene" )
    )
    

     

  • Hi,

    Ensure that the month slicer is from the Calendar table.  Simplify your measure to

    =SUM('Detalle Facturacion'[Cantidad Facturada])

2 Replies

  • Hi,

    I am not sure how your semantic model looks like, but please try something like below whether it works.

     

    KEEPFILTERS DAX FUNCTION Microsoft Learn 

     

    Cantidad Facturada Enero =
    CALCULATE (
        SUM ( 'Detalle Facturacion'[Cantidad Facturada] ),
        KEEPFILTERS ( 'Detalle Facturacion'[Mes Nombre] = "Ene" )
    )
    

     

  • Hi,

    Ensure that the month slicer is from the Calendar table.  Simplify your measure to

    =SUM('Detalle Facturacion'[Cantidad Facturada])