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

Special date parameters

Hi,

 

I'm trying to create a user input date that serves the same purpose as the screenshot below in excel.

 

I've come across the what-if parameter, but this is beyond my knowledge of power bi.

 

PBI q.PNG

 

Would appreaciate any insights.

 

Thanks!

2 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

@Shiqi_C , Create an independent date table and take a slicer from that

 

then create a measure like 


measure =

var _cnt = countrows(filter(Table, Table[Intial Date]<= seletedvalues('Date'[Date]) && (Table[End Date] >= seletedvalues('Date'[Date]) || isblank(Table[End Date] ) ) ) )
return
if(isblank(_cnt), "N", "Y")

 

View solution in original post

Hi Amit

 

Thanks for the quick response Amit, this is really helpful.

 

After a few tries on my hand, I managed to show the data correctly. The only thing is that I can only apply this measure for each visual rather than on the whole page. I'm using May 2020 version of power bi.

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@Shiqi_C , Create an independent date table and take a slicer from that

 

then create a measure like 


measure =

var _cnt = countrows(filter(Table, Table[Intial Date]<= seletedvalues('Date'[Date]) && (Table[End Date] >= seletedvalues('Date'[Date]) || isblank(Table[End Date] ) ) ) )
return
if(isblank(_cnt), "N", "Y")

 

Hi Amit

 

Thanks for the quick response Amit, this is really helpful.

 

After a few tries on my hand, I managed to show the data correctly. The only thing is that I can only apply this measure for each visual rather than on the whole page. I'm using May 2020 version of power bi.

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.