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

View all the Fabric Data Days sessions on demand. View schedule

Reply
Vsaez
Frequent Visitor

Problem to filter visual

Hello, I hope you are well

I have a column, called Year_Month, where I have a combination between the year and the month, for example 202101, 202102, etc etc

I have to filter a visual by two values from this column, 202105 and 202005:

Vsaez_0-1620165126114.png

I made a measure in DAX to filter it, which is the following:

Comparacion_Dia =
CALCULATE (
SUM ( '20 Medidas Reclamos'[Reclamo] ),
FILTER ('01 Tiempo Creación',
'01 Tiempo Creación'[Año Mes] = "202105" || '01 Tiempo Creación'[Año Mes] = "202005"
)
)

This formula works, but it has the dates as string type
So, I did this measurement in DAX so that based on current date it will calculate the value I need, for this year and last year.

 

Filtro Año Mes Actual =
VAR Fecha_actual=MAX('01 Tiempo Creación'[Date])
RETURN

IF(
LEN(MONTH(Fecha_actual))=1,
YEAR(Fecha_actual)&0&MONTH(Fecha_actual),
YEAR(Fecha_actual)&MONTH(Fecha_actual))
 
This measure gives me the value 202105, which was what I needed. However, when I replace this measure with the string I had in the previous measure, the filter doesn't work for me ...

Does anyone know why that will happen?

Thank you!

2 REPLIES 2
v-janeyg-msft
Community Support
Community Support

Hi, @Vsaez 

 

Is your problem been solved? I see that you didn't follow up. Have you checked the reply of others?

According to you description, The result of your two measures is not one thing, one is the value of sum, and the other is to return date. So I don't understand your question very well, Can you explain it in detail? Or share more information like your modified code,etc. So we can help you soon.

 

Best Regards

Janey Guo

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Greg_Deckler
Community Champion
Community Champion

@Vsaez A guess but check your data types and make sure that everything is a string and that you don't have a whole number data type in there for some reason. If you do, try adding & "" to it to force it to a string.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors