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
Chanleakna123
Post Prodigy
Post Prodigy

Total 12 MAT Último 2 año a partir de (mayo 2018-junio 2017)

Hola a todos

Quiero crear fórmula:

12 MAT idealmente desde (mayo 2018-junio2017). Quiero comparar la tendencia entre 12MAT año a Año.

En este momento he logrado 2 fórmulas a continuación, y me gustaría crear otra fórmula de 12 MAT de (mayo 2018-junio2017).

**12 MAT. ( May2020-Jun2019 ) ? IF(ISBLANK('UC & NSR Type'[$NSR O UC]),BLANK(),CALCULATE([$NSR O UC],DATESINPERIOD('445 Calendar'[Date],ENDOFMONTH('445 Calendar'[Date]),-12,MONTH)))
**12MAT L1Y (mayo 2019-junio 2018) - CALCULATE('UC & NSR Type'[$NSR O UC],DATESINPERIOD('445 Calendar'[Fecha],ENDOFMONTH(DATEADD('445 Calendar'[Fecha],-12,MONTH)),-12,Mes))
** 12MAT L2Y (mayo 2018-jun2017) - ?????

12MAT.PNG

3 REPLIES 3
MFelix
Super User
Super User

Hola @Chanleakna123 ,

En lugar de hacer que sea 12 meses en cada una de las medidas por qué no hacer un cálculo de año:

12MAT L1Y ( May 2019-Jun 2018) =
CALCULATE (
    'UC & NSR Type'[$NSR Or UC],
    FILTER (
        ALL ( '445 Calendar'[Date] ),
        '445 Calendar'[Date]
            <= ENDOFMONTH ( DATEADD ( '445 Calendar'[Date], -1, YEAR ) )
            && '445 Calendar'[Date]
                >= ENDOFMONTH ( DATEADD ( '445 Calendar'[Date], -2, YEAR ) )
    )
)


12MAT L2Y ( May 2018-Jun 2017) =
CALCULATE (
    'UC & NSR Type'[$NSR Or UC],
    FILTER (
        ALL ( '445 Calendar'[Date] ),
        '445 Calendar'[Date]
            <= ENDOFMONTH ( DATEADD ( '445 Calendar'[Date], -2, YEAR ) )
            && '445 Calendar'[Date]
                >= ENDOFMONTH ( DATEADD ( '445 Calendar'[Date], -3, YEAR ) )
    )
)

Tenga en cuenta que su puede necesitar algunos ajustes, especcially en la fecha de inicio que se establece para fin de mes (y probablemente lo necesite para comenzar el mes.


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



@MFelix , hola , he utilizado su cálculo, no funciona de mi lado, cuando puse al lado de 2 otros cálculos que he compartido.

Ahora tengo año Filtro 2020 , Cuando puse la fórmula de la suya en , se muestra en blanco.

@Chanleakna123

¿Puede compartir un archivo de ejemplo?


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



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.