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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.