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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

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
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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

Top Solution Authors