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 August 31st. Request your voucher.

Reply
waydec
Frequent Visitor

Lookup to return a value based on User selection

Hi,

I'm looking for advice on the best way to return a corresponding date/time serial number based on a user-selected date and time selection so that the user can then use the date/time serial number to filter records using an existing table that has a date/time serial column stored as a decimal (eg.  44378.41667 is the serial number for 1 July 2021 10:00 AM).

This is my attempt to get around the lack of a pure date/time filter in Power BI that allows the using to select both date and time using the between option.  Not interested in "relative" dates and times but using the actual date and time in the form of a date/time serial numbers in a from and to filter as a workaround for now given the intended use of the report.

Any ideas and solutions here will be greatly appreciated.  It is a critical issue for us given the nature of our business (emergency services).  A shame that other BI products have this feature but Power BI does not.

Kind regards,

Waydec

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @waydec ,

 

Create a calculated table to show  datetime in decimal format.

FromDateTime = GENERATESERIES(INT(MIN(Data[StartDateTime])), INT(MAX(Data[EndDateTime]))+1, 0.01)

Then create a calculated column to show datetime format.

Measure:

FromDateTime Value = SELECTEDVALUE(FromDateTime[FromDateTime], INT(TODAY())-1)

Calculated column:

SelectedFromDateTime = [FromDateTime Value]

Table looks like as below.

1.png

Slicer looks like as below.

1.png

For more details you may refer to this blog: How To DataTime Range Slicer

Your demand is a good idea, while it is not supported to implement in Power BI currently.
You can submit a new idea to improve the Power BI.
It is a place for customers provide feedback about Microsoft Office products . What’s more, if a feedback is high voted there by other customers, it will be promising that Microsoft Product Team will take it into consideration when designing the next version in the future.

 

Best Regards,
Rico Zhou

 

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

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @waydec ,

 

Create a calculated table to show  datetime in decimal format.

FromDateTime = GENERATESERIES(INT(MIN(Data[StartDateTime])), INT(MAX(Data[EndDateTime]))+1, 0.01)

Then create a calculated column to show datetime format.

Measure:

FromDateTime Value = SELECTEDVALUE(FromDateTime[FromDateTime], INT(TODAY())-1)

Calculated column:

SelectedFromDateTime = [FromDateTime Value]

Table looks like as below.

1.png

Slicer looks like as below.

1.png

For more details you may refer to this blog: How To DataTime Range Slicer

Your demand is a good idea, while it is not supported to implement in Power BI currently.
You can submit a new idea to improve the Power BI.
It is a place for customers provide feedback about Microsoft Office products . What’s more, if a feedback is high voted there by other customers, it will be promising that Microsoft Product Team will take it into consideration when designing the next version in the future.

 

Best Regards,
Rico Zhou

 

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

Hi @Anonymous,

 

Awesome, this works for me.  Thank you very kindly.  I did post the concept as an Idea a while back but no luck so far.

 

Kind regards,

Waydec

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.