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
Xaarie
Regular Visitor

Filter within a measure

I am trying to filter a denominator in a measure for the last 12 months.

 

My measure so far is Divide([WIP + debtors], [YTD fees}).

 

I need the YTD fees to be a rolling YTD. I have got the amount i require in another measure by applying a filter on a column of 

Days from today = DATEDIFF(vwBillTotals[Date],TODAY(),DAY) where less than 365
on this measure  
YTD fees = sum(vwBillTotals[BilledExVat])
 
But I don't know how to put this filter in the measure expression so that the orginal measure doesnt include all the data as the denominator and not just the last 365 days which is what i want.
Sorry if this is an easy question I am very new to this.
thanks
 
1 ACCEPTED SOLUTION
Mariusz
Community Champion
Community Champion

Hi @Xaarie 

 

Try DATESINPERIOD
https://docs.microsoft.com/en-us/dax/datesinperiod-function-dax

 

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
LinkedIn

 

View solution in original post

3 REPLIES 3
Mariusz
Community Champion
Community Champion

Hi @Xaarie 

 

Try DATESINPERIOD
https://docs.microsoft.com/en-us/dax/datesinperiod-function-dax

 

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
LinkedIn

 

Thanks.

I have tried that in both direct query and import mode and it gives a 0 value. formula is:

DIVIDE([WIP + debtors], (CALCULATE(SUM(vwBillTotals[BilledExVat]),DATESINPERIOD(vwBillTotals[Date],TODAY(),-365,day))))

Sorted thanks for the info

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.