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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
Axiomite
Resolver II
Resolver II

If in selected month

Hi,
Trying to use the slicer selected month rather the current month

This works:

Axiomite_1-1663664013737.png

 

But having an error on the following:

 
Axiomite_0-1663663988245.png

 

Can anyone help.
 
Kind regards,
Niel

 

1 ACCEPTED SOLUTION

@JorgePinho  - many thanks for your reply. I used a work around by created a column displaying current month and year. 


Filter Date =
 VAR __max = MAXX(factTable,factTable[TxDate])
VAR __year = YEAR(__max)
VAR __day = DAY(__max)
VAR __month = MONTH(__max)
RETURN
DATE(__year,__month-3,__day)

I have then gone and used the other date and compared it with the Filter Date column in the above if statement and it solve my problem. 
Kind Regards,
Niel

View solution in original post

2 REPLIES 2
JorgePinho
Solution Sage
Solution Sage

MONTH doesn't allow a column has argument, so you have to use a summarize function. Try to correct it to MONTH(MAX([First ...])) 

@JorgePinho  - many thanks for your reply. I used a work around by created a column displaying current month and year. 


Filter Date =
 VAR __max = MAXX(factTable,factTable[TxDate])
VAR __year = YEAR(__max)
VAR __day = DAY(__max)
VAR __month = MONTH(__max)
RETURN
DATE(__year,__month-3,__day)

I have then gone and used the other date and compared it with the Filter Date column in the above if statement and it solve my problem. 
Kind Regards,
Niel

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! It's time to submit your entry.

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

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.