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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
Anonymous
Not applicable

WhatIf Date with DATESBETWEEN formula

Hi Support, 

 

I am trying to select a random date in between a start date and end date within my data. 

 

Live Policies = IF(DATESBETWEEN("Random date selected",Policies[StartDate],Policies[Enddate]),1,0)
 
I was thinking create a WHATIF date parameter and some how use it in the above formula where "Random date selected" currently is.
 
Therefore if i change the date the formlua output also changes. 
 
e.g. 31/08/2021  could give 35 live policies 
       30/09/2021 could give 56 live policies 
 
However i am not sure how to approach this. Is it possible to please get some guidance. 
 
Thank you, 
 
Parin 
  

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi suppport, 

 

I have found the solution after grinding away: 

 

Live_pol_try = CALCULATE(DISTINCTCOUNT(Policies[PolicyNo]),

FILTER(ALL(Policies),Policies[StartDate]<= SELECTEDVALUE(Reported_Date[Parameter]) &&
Policies[Actual_Enddate] >= SELECTEDVALUE(Reported_Date[Parameter])))
 
based on creating a whatif date parameter which can be selected on a slicer. 
 
Thanks, 
 
Parin

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi suppport, 

 

I have found the solution after grinding away: 

 

Live_pol_try = CALCULATE(DISTINCTCOUNT(Policies[PolicyNo]),

FILTER(ALL(Policies),Policies[StartDate]<= SELECTEDVALUE(Reported_Date[Parameter]) &&
Policies[Actual_Enddate] >= SELECTEDVALUE(Reported_Date[Parameter])))
 
based on creating a whatif date parameter which can be selected on a slicer. 
 
Thanks, 
 
Parin

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.