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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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