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
tomislav
Frequent Visitor

DATEADD measure for # of intervals

HI, 

I have report level calendar filter, and I'm using DISTINCTCOUNT(Calendar[Date]) to see how many days is selected.

 

 

NumberOfSelectedDays := DISTINCTCOUNT(Calendar[Date])

CAshIn_Previous_Period := CALCUATE( [CashIn]; DATEDD(Calendar[Date]; -[NumberOfSelectedDays]; DAYS)

And I do not get wanted shift in days, I get just shift of one day. Please advise. Thanks

 

1 REPLY 1
itsmebvk
Continued Contributor
Continued Contributor

@tomislav  Try to use following method

 

Count = DATEDIFF(
					MIN(Sheet1[Date]),
					MAX(Sheet1[Date]),
					DAY
					)
Calc Discount = CALCULATE([Sum Discount],DATEADD(Sheet1[Date],-[Count],DAY))

See the attached  PBIX, correct me if I misunderstood your requirement.

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.