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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
ElenaCarciLopez
Helper II
Helper II

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
Helper II
Helper II

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
Helper II
Helper II

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.