Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Estoy haciendo un reporte en PBI donde muestro datos actuales vs mes anterior vs año anterior. Para una mejor visualizacion estoy usando Categorias en una matriz. Para poder mostrar todas las categorias aunque no contengan datos cree una tabla con las categorias. La tabla se llama Categorias[Categorias]. Arrastre este campo a la matriz en mis filas y para calcular los conteos de mes anterior utilice esta formula:
MesAnterior = CALCULATE(
SUM(Consulta[CONTEO MES ACTUAL]),
PREVIOUSMONTH(Consulta[FECHA]),
REMOVEFILTERS(Consulta),
VALUES(Categorias)
)
El total que me regresa es correcto (lo verifique en la base de datos) pero a la hora de distribuirlo por categoria en la matriz. El patron que observo es que solo me muestra datos en la matriz que esten presente en el Actual.
El total que es 43 esta bien, pero 39 + 3 es 42. Lo que Significa que hay una categoria que no se esta mostrando para el mes anterior.
Solved! Go to Solution.
Hi @miguealejandror ,
PREVIOUSMONTH as a time-intelligence function, please give preference to referencing the argument from the calendar table. Refer to the following Note subsection.
Please try:
PreviousMonth =
CALCULATE(
SUM(Consulta[CONTEO MES ACTUAL]),
PREVIOUSMONTH('Date'[Date]),
REMOVEFILTERS(Consulta),
VALUES('Categorias'[category])
)
About month-related calculations calendar table:
Month-related calculations – DAX Patterns
Best Regards,
Gao
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data in the Power BI Forum
Hi @miguealejandror ,
PREVIOUSMONTH as a time-intelligence function, please give preference to referencing the argument from the calendar table. Refer to the following Note subsection.
Please try:
PreviousMonth =
CALCULATE(
SUM(Consulta[CONTEO MES ACTUAL]),
PREVIOUSMONTH('Date'[Date]),
REMOVEFILTERS(Consulta),
VALUES('Categorias'[category])
)
About month-related calculations calendar table:
Month-related calculations – DAX Patterns
Best Regards,
Gao
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data in the Power BI Forum
@miguealejandror , Try using
PreviousMonth = CALCULATE(
SUM(Query[CURRENT MONTH COUNT]),
PREVIOUSMONTH(Query[DATE]),
ALL(Categories)
)
Proud to be a Super User! |
|
The REMOVEFILTER option is importand because I'm filter by DATE on the Consulta Table, I try:
PreviousMonth = CALCULATE(
SUM(Consulta[CONTEO MES ACTUAL]),
PREVIOUSMONTH(Consulta[FECHA]),
REMOVEFILTERS(Consulta),
ALL(Categorias)
)
But it show me 43 on all categories.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
143 | |
75 | |
63 | |
52 | |
47 |
User | Count |
---|---|
218 | |
86 | |
64 | |
63 | |
60 |