Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more

Reply
ElenaCarciLopez
Resolver I
Resolver I

FILTRO AUTOMATICO EN UNA MATRIZ PARA QUE SOLO APAREZCAN DESDE EL MES ACTUAL AL FUTURO

Hola!

Tengo una matriz que muestra unos valores por meses, desde el mes actual hasta enero del 2026. 

ElenaCarciLopez_1-1718964753238.png

 

Actualmente el filtro tengo que ir quitando los meses a mano, cada vez que empezamos un nuevo mes: 

ElenaCarciLopez_0-1718964637823.png

Hay alguna manera que el filtro sea automático, es decir que detecte en que mes estamos y nos muestre los valores desde el mes actual hasta el último mes que tengo datos. 

He probado con Fecha Relativa pero me da la opción de este mes o desde el mes que viene y no los dos juntos.

Existe la posibilidad de automatizarlo? o debo seguir haciendolo a mano?

Muchas gracias por vuestra ayuda!

1 ACCEPTED SOLUTION
ElenaCarciLopez
Resolver I
Resolver I

He encontrado la solución de una forma bastante sencilla al final.

He creado en mi tabla calendario una columna que me indique si es mes actual o fututo "SI" y si es mes pasado "NO"

EsMesPasado-ActualOFuturo = IF(VALUE(
    [Month Year]) >= DATE(YEAR(TODAY()), MONTH(TODAY()), 1),
    "Si",
    "No"
)

y en el panel de Filtros he creado un filtro para el visual de matriz configurandolo para que me muestre los valores SI

 

View solution in original post

5 REPLIES 5
ElenaCarciLopez
Resolver I
Resolver I

He encontrado la solución de una forma bastante sencilla al final.

He creado en mi tabla calendario una columna que me indique si es mes actual o fututo "SI" y si es mes pasado "NO"

EsMesPasado-ActualOFuturo = IF(VALUE(
    [Month Year]) >= DATE(YEAR(TODAY()), MONTH(TODAY()), 1),
    "Si",
    "No"
)

y en el panel de Filtros he creado un filtro para el visual de matriz configurandolo para que me muestre los valores SI

 

MFelix
Super User
Super User

Hi @ElenaCarciLopez ,

 

You need to add a relative data has you refer. On your calendar table add a column that does the difference between YearMonth for today and YearMonth for the data you need

 

Power Query Syntax:

 Number.From  (Number.ToText (Date.Year([Date]) ) &

Text.PadStart( Number.ToText (Date.Month([Date]) ), 2,"0"))- Number.From(Number.ToText (Date.Year(DateTime.LocalNow()) ) &

Text.PadStart( Number.ToText (Date.Month(DateTime.LocalNow()) ), 2,"0"))

 

DAX Column:

MonthRelative =  (YEAR(Query1[Date]) & FORMAT(MONTH(Query1[Date]), "00")) - (YEAR(TODAY()) & FORMAT(MONTH(TODAY()), "00"))

 

Result will be similar to this

MFelix_1-1718976632622.png

 

Has you can see for current month is zero for next months is 1

 

Now use this column to filter the visual:

MFelix_2-1718976652725.png

 

 

 


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



Many thanks for your answer. That's the result I am looking for.

I have an answer, how and where I should add this:

Power Query Syntax:

 Number.From  (Number.ToText (Date.Year([Date]) ) &

Text.PadStart( Number.ToText (Date.Month([Date]) ), 2,"0"))- Number.From(Number.ToText (Date.Year(DateTime.LocalNow()) ) &

Text.PadStart( Number.ToText (Date.Month(DateTime.LocalNow()) ), 2,"0"))

  Thanks!

Assuming you have tyour calendar table done in Power Query this code is for the creation of a new column on the calendar table.


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



I don't succeed

Helpful resources

Announcements
March PBI video - carousel

Power BI Monthly Update - March 2025

Check out the March 2025 Power BI update to learn about new features.

March2025 Carousel

Fabric Community Update - March 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors
Top Kudoed Authors