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
Anonymous
Not applicable

Alternate of Time intelligence function (DATESBETWEEN and DATESINPERIOD)

Hi,
I am using DATESBETWEEN for previous days calculation. 
for eg. in date slicer i have selected date from 01/07/2021 and 10/07/2021 (10 days)
then as per the logic measure will do the calculations for previous 10 days ie. (21/06/2021 to 30/06/2021)

But I am using RSL and because of this measure is not working,
is there any way to replace this time intelligence function.

1 ACCEPTED SOLUTION

Hi @Anonymous 

vxiaotang_1-1625557177137.png

https://docs.microsoft.com/en-us/dax/removefilters-function-dax#remarks

please try function ALL(),

https://docs.microsoft.com/en-us/dax/all-function-dax

 

Best Regards,

Community Support Team _ Tang

If this post helps, please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

@selimovd Thanks for your reply 

I have the date 

Surya9_0-1625242620105.png

Created the date table based on this table

date = CALENDAR(MIN('Table'[Date]),MAX('Table'[Date]))
Surya9_1-1625242771446.png

and the measure using here is 

KPIs = CALCULATE(DISTINCTCOUNT('Table'[KPI ID]))
Start date = MIN('date'[Date])
End date = MAX('date'[Date])
Prev Start Date = [Prev End Date]- (DATEDIFF([Start date],[End date],DAY))
Prev End Date = [Start date]-1
Prev KPIs = CALCULATE(DISTINCTCOUNT('Table'[KPI ID]),
                    DATESBETWEEN('date'[Date],[Prev Start Date],[Prev End Date]))
I am facing problem in Prev KPIs, this is working fine here but i am using RLS on Agent id so the DATESBETWEEN is not working 
I used the below measure 
Prev KPIs = CALCULATE(DISTINCTCOUNT('Table'[KPI ID]),
                   REMOVEFILTERS('date'[Date]),
                 FILTER('Table','Table'[Date] >= [Prev Start Date] && 'Table'[Date] <= [Prev End Date]))
but the result is blank
 



Hi @Anonymous 

vxiaotang_1-1625557177137.png

https://docs.microsoft.com/en-us/dax/removefilters-function-dax#remarks

please try function ALL(),

https://docs.microsoft.com/en-us/dax/all-function-dax

 

Best Regards,

Community Support Team _ Tang

If this post helps, please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable


All function is working in RLS but in document its written that

Surya9_0-1625584529747.png

 

selimovd
Super User
Super User

Hey @Anonymous ,

 

we all don't know your data model and your measures.

So we cannot tell you why things are not working and how to fix that.

 

Share more information and you will get help here in the community.

 

Best regards
Denis
 

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!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.