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

Obtiene el valor de diciembre del año pasado basado en la segmentación

Hola a todos soy un principiante aquí, así que lo que quiero hacer es como sigue :

Tengo una columna de año (2014 , 2015, 2016 ...) y una columna de mes (01, 02, 03, 04, 05 ... 12) en mi mesa de hechos. (tanto como tipo de datos de número entero)

Tengo una cortadora donde el usuario puede seleccionar entre diferentes años disponibles.

Ahora quiero crear una medida en la que si el usuario selecciona 2020 en la segmentación de datos (sin sentido del mes) obtiene el valor (Y-2019 & M-12). ¿Cómo lo hago?

Ejemplo:

añoMesValor
20141400
20142500
20143700
2014124000
201514500
201526000
201537000
201548000
201559000

SLICER : El usuario selecciona Y-2015 (independientemente del MES)

Medida debe devolver : 4000 que es el valor que corresponde al valor de diciembre de 2014 (Y-N-1 & M-12)

Gracias de antemano

1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

Hola

Puede descargar mi archivo PBI desde aquí.

Espero que esto ayude.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

4 REPLIES 4
Ashish_Mathur
Super User
Super User

Hola

Puede descargar mi archivo PBI desde aquí.

Espero que esto ayude.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
CNENFRNL
Community Champion
Community Champion

Hola, @adnane_k , sugiero construir una columna de fecha basada en columnas de año y mes, que es una manera más robusta. Se adjunta un archivo pbix para obtener más información.

Screenshot 2020-11-22 215400.png

Entonces, es posible que desee probar esta medida

Dec Previous Year = 
VAR __dec_py =
    ENDOFYEAR (
        CALCULATETABLE ( DATEADD ( 'Table'[DATE], -1, YEAR ), ALL ( 'Table'[MONTH] ) )
    )
RETURN FORMAT(__dec_py, "MMMM yyyy") & UNICHAR(10) &
    MAXX ( FILTER ( ALL ( 'Table' ), 'Table'[DATE] = __dec_py ), 'Table'[VALUE] )

Screenshot 2020-11-22 215609.png


Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

Fowmy
Super User
Super User

@adnane_k

Utilice la siguiente medida, modifique los nombres de tabla y columna

December Amount = 
CALCULATE(
    SUM(Table3[VALUE]),
    FILTER( 
        all(Table3),
        Table3[YEAR] = SELECTEDVALUE(Table3[YEAR]) - 1 && Table3[MONTH] = 12
    )
)

________________________

Si mi respuesta fue útil, considere Aceptarla como la solución para ayudar a los otros miembros a encontrarla

Haga clic en el icono Thumbs-Up si le gusta esta respuesta 🙂

Youtube Linkedin

en consecuencia:


Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Anonymous
Not applicable

devuelve filas con valores similares

adnane_k_0-1606153265398.png

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.