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
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
PBIApril_Carousel

Power BI Monthly Update - April 2025

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

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

April2025 Carousel

Fabric Community Update - April 2025

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

Top Solution Authors