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

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
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.