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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
sydv
New Member

How to calculate Sum of Amount , for specific list of ID's falling in one date range?

I need to create a visual with calculate the sum of AmountCY and AmountLY, withrevenue year and month. The data has Amount, IDs, RDate, IntDate. I have to calculate sum of Amount for previous year(based on RDate column) for only those IDs which were present in selected date range and on a particular IntDate. I have calculated two measures AmountCY and AmountLY.

where Rdate range =01/01/2020 to 10/30/2020

I need AmountLY values only for Id =110 . As the Rdate for Previous year will be =01/01/2019 to 10/30/2019. and only this id was present in selected Rdate range(current year range)

AmountLYIDAmountLYRDateIDate
10000100 5/27/20207/26/2020
 102126.39/6/20197/26/2020
 11030003/30/20197/26/2020
3000110 4/18/20207/26/2020
 1227.037/12/20197/26/2020
 12215007/13/20197/26/2020
 1321052.55/20/20197/26/2020
2 REPLIES 2
amitchandak
Super User
Super User

@sydv , You can join RDate with date table and use that as slicer

 

Sum(Table[AmountCY]) is for that range

Year behind = CALCULATE(Sum(Table[AmountCY]),dateadd('Date'[Date],-1,Year))

 

To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :radacad sqlbi My Video Series Appreciate your Kudos.

Hi,

 

Thanks for points,

But this would again give the same values as I have in AmountLY measure.

while I need values against only those ID's in Year Behind measure which are present in current year. i.e. AmountLY for ID -110 only. 

 

Regards

 

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

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