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
CloudMonkey
Post Prodigy
Post Prodigy

Letting user set date variable for calculated measures

Hi,

 

Please can you tell me how to allow a user to set a date variable (on a report page) which will then be used by a calculated measure?

 

I tried clicking on "New Parameter" expecting to see an option to enter a date but there doesn't appear to be such an option?:

 

parameter date.JPG

 

Thanks,

 

CM

1 ACCEPTED SOLUTION
7 REPLIES 7
JoyCornerstone
Resolver II
Resolver II

I use a slicer for dates and allow them to pick a single date or a date range. That value then becomes the selected value for the measure.  

Hi @JoyCornerstone, thanks - is that a normal slicer or a parameter slicer? How did you set the data type to "date"?

A normal slicer.  In your data model, you should have a Calendar table that contains a date range for the set of dates in your system.  If you don't have that, you'll need to go search for how to set that up and connect it to your underlying table.

Thanks @JoyCornerstone , sorry but how do you get the selected value into a parameter/measure? If I create a slicer doesn't that just filter the underlying tables?

Fantastic, thank you Smiley Happy

CloudMonkey
Post Prodigy
Post Prodigy

I found a workaround. Just set the parameter up as a whole number, then find the parameter's field in the list of data tables and change the data type to date. That seems to change the parameter slicer to accept dates.

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.