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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
michael_knight
Post Prodigy
Post Prodigy

Work a Date Filter into a Measure

Hi,

 

I've got this filter on one of my visuals 

Date Filter.PNG

This is the measure that I've used for the visual above 

Leads (RHB) - Count = COUNTA(Opportunity[RHB Date of Enquiry]) 

I also have another measure so I can have a relationship with a date table

RHB Leads = 
CALCULATE([RHB Leads - Count],
USERELATIONSHIP('Opportunity'[RHB Date of Enquiry], 'Full Date'[Full Date]))

 

 

So what I want to do is include the filter from the first image into the 'Leads (RHB) - Count' measure.

 

On the visual above I will also be looking at previous fiscal years, so for example if I'm looking at 19/20 Fiscal Year, then add RHB Created is on or after 01/04/2019

 

19/20 FY = 01/04/2019 Created On

18/19 FY = 01/04/2018 Created On

17/18 FY = 01/04/2017 Created On

 

Can anyone help me with this?

 

Thanks,

Mike

8 REPLIES 8
Anonymous
Not applicable

Hi @michaelknight94,

 

If I understand you correctly, you can modify your measure as below:

RHB Leads =

CALCULATE (

    [RHB Leads - Count],

    FILTER (

        Opportunity,

        FORMAT ( Opportunity[RHB Date of Enquiry], "YYYYMM" ) >= "201704"

            && FORMAT ( Opportunity[RHB Date of Enquiry], "YYYYMM" ) < "201804"

    ),

    USERELATIONSHIP ( 'Opportunity'[RHB Date of Enquiry], 'Full Date'[Full Date] )

)

Or create a slicer and result would be shown as below:

1.PNG

 

Best Regards,

Jay

Community Support Team _ Jay Wang

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

Hi @Anonymous 

 

Thanks for the help, wasn't successful with that unfortunatly. After doing that I didn't get any results

 

I'll add the PBIX file so you can have a look if you want to have a look 

https://www.dropbox.com/s/ojxkg7fj5rjdf1i/Acquisitions%20-%20Community.pbix?dl=0

 

Thanks,

Mike

 

 

Anonymous
Not applicable

Hi @michael_knight ,

 

Thank you for your Pbix, I modify the measure and the result would be show as below:

RHB Leads =
CALCULATE(
[RHB Leads - Count],FILTER(Opportunity,FORMAT(Opportunity[RHB Created On],"MMDD")>="0401"),
USERELATIONSHIP('Opportunity'[RHB Date of Enquiry], 'Full Date'[Full Date]))
2.PNG3.PNG
Let me know if the result is what you want.
 

Best Regards,

Jay

Community Support Team _ Jay Wang

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

Hi @Anonymous ,

 

Thanks for giving it a go. It works if you're just looking at the current Fiscal Year but if you try to use the Fiscal Year date slicer and look at the previous years it doesn't work. 

acqui.PNG

Getting closer though!

 

Thanks,

Mike

Hi, this is stil an issue. 

 

It works fine for the current fiscal years 19/20, however if I go back to the fiscal year 18/19 that's when I get the discrepancies in the data. 

ffghetyj.PNG The left visual is when I tried using the filter that was suggested above

RHB Leads = 
CALCULATE(
[RHB Leads - Count],FILTER(Opportunity,FORMAT(Opportunity[RHB Created On],"MMDD")>="0401"),
USERELATIONSHIP('Opportunity'[RHB Date of Enquiry], 'Full Date'[Full Date]))

The right visual is when I put in a filter on in the filter plain, like so

Capture.PNG

 

Thanks,

Mike

Hi, 

 

Still struggling on this issue

 

Can anyone help?

 

Thanks,

Mike

Bump

michael_knight
Post Prodigy
Post Prodigy

Still struggling with this if anyone can help.

 

Thanks,

Mike

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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