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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
daliux
Frequent Visitor

Amount 28 days ago with filter

Hello,

 

I need to count Amount 28 days ago. As you see, there is a feature (borrower_type). Hepl me, please

daliux_0-1639738589394.png

 

1 ACCEPTED SOLUTION

Hi @daliux 

 

Try this:

Value -28 =
var _date = 'Date 28 days ago'[Date-28] 
Var _BT =  'Date 28 days ago'[Borrower_Type] 
return
CALCULATE(SUM('Date 28 days ago'[Amount]),filter(all('Date 28 days ago'),'Date 28 days ago'[Date]=_date&& 'Date 28 days ago'[Borrower_Type]=_BT ) )


If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: 
www.linkedin.com/in/vahid-dm/


 

View solution in original post

5 REPLIES 5
ValtteriN
Super User
Super User

Hi,

Here is one way to do this:

Value -28 =
var _date = 'Date 28 days ago'[Date-28] return
CALCULATE(SUM('Date 28 days ago'[Amount]),all('Date 28 days ago'),'Date 28 days ago'[Date]=_date)

Example:
ValtteriN_0-1639739620800.png


I hope this helps to solve your issue and if it does consider accepting this as a solution and giving the post a thumbs up!





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Thank you, 

 

It works, but not properly because it does not diffenciate amount between category (Borrower_Type). Do I need filter in this formula?

Like Vahid points out just add a variable for the borrower type and you are good to go. I didn't notice you wanted to differentiate based on it also.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Hi @daliux 

 

Try this:

Value -28 =
var _date = 'Date 28 days ago'[Date-28] 
Var _BT =  'Date 28 days ago'[Borrower_Type] 
return
CALCULATE(SUM('Date 28 days ago'[Amount]),filter(all('Date 28 days ago'),'Date 28 days ago'[Date]=_date&& 'Date 28 days ago'[Borrower_Type]=_BT ) )


If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: 
www.linkedin.com/in/vahid-dm/


 

Thank you very much!!!!!

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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