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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors