Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Estimados Buenas noches,
Tengo una duda quisiera saber que dax podria utilizar para realizar la suma mes a mes de los siguientes datos,
en excel seria de esta forma.
La suma seria para el mes de enero del mes actual, el primer dia de febrero del año anterior hasta el ultimo dia de enero del mes actual.
Podria calcularlo con una medida que genere la suma colocando los limites con el dax fechas entre las fechas a mano, pero quisiera que se genere una tabla con esta información ya que se debe de ir alimentando mes a mes automáticamente.
Intente de esta manera pero no logre el resultado que queria.
Agredeceria mucho que me ayuden con alguna respuesta.
Solved! Go to Solution.
Edited
Hi @Jefe_03
Try this code to add a new column to your table:
Acum 2021 =
VAR _Date = 'Table'[Anio_Mes]
VAR _LDate =
DATE ( YEAR ( _Date ) - 1, MONTH ( _Date ) + 1, DAY ( _Date ) )
VAR _Year =
YEAR ( 'Table'[Anio_Mes] )
VAR _Acum =
CALCULATE (
SUM ( 'Table'[_Total] ),
FILTER ( 'Table', 'Table'[Anio_Mes] <= _Date && 'Table'[Anio_Mes] >= _LDate )
)
RETURN
IF ( _Year > 2020, _Acum, BLANK () )
Output:
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos🙏!!
Thank you!!😁
Edited
Hi @Jefe_03
Try this code to add a new column to your table:
Acum 2021 =
VAR _Date = 'Table'[Anio_Mes]
VAR _LDate =
DATE ( YEAR ( _Date ) - 1, MONTH ( _Date ) + 1, DAY ( _Date ) )
VAR _Year =
YEAR ( 'Table'[Anio_Mes] )
VAR _Acum =
CALCULATE (
SUM ( 'Table'[_Total] ),
FILTER ( 'Table', 'Table'[Anio_Mes] <= _Date && 'Table'[Anio_Mes] >= _LDate )
)
RETURN
IF ( _Year > 2020, _Acum, BLANK () )
Output:
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos🙏!!
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 14 | |
| 7 | |
| 4 | |
| 4 | |
| 3 |
| User | Count |
|---|---|
| 23 | |
| 10 | |
| 10 | |
| 6 | |
| 5 |