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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
Anonymous
Not applicable

Date Parameter Used in Calculations

Hi, I have a use case where I need to use a date field in calculations within a PowerBI workbook. The calculations work fine when I use a hard-coded field as the date, but I need this date to be user selected instead. I am familar with Tableau and would use a Parameter in order to achieve this there. However, I can't create a date parameter in PowerBI. My workaround was two create two parameters, a year selector & a month selector and use those to create a dynamic "date selector" field using this calculation: 

Date Selector = DATE('Year Parameter'[Year Parameter Value] ,'Month Parameter'[Month Parameter Value],31). This field is a measure since only measures can use paramters in them. When 2022 is selected for the year and 12 selected for the month, I can get this value which is great:
allison_t_0-1677880409754.png

 

The problem arises in the calculations that use this. Since the calculations are columns and not measures, they don't read the value correctly and instead appear to be using a date of 12/31/1899 no matter what is selected in the parameters. I can't change my columns to be measures instead since they really do need to be calculated at a per-line basis, and have IF statements that compare multiple dates.
 
Is there any way to have a user-input date field that can then be read correctly in calculated columns?
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Thanks @Anonymous for the confirmation. I ended up getting something to work by creating a date table and then doing a crossjoin between my original data & the date table. Not the most performant solution, but luckily my data set is relatively small.

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Thanks @Anonymous for the confirmation. I ended up getting something to work by creating a date table and then doing a crossjoin between my original data & the date table. Not the most performant solution, but luckily my data set is relatively small.

Anonymous
Not applicable

Hi @Anonymous ,

Thanks for your feedback and sharing your solution here. Could you please mark your post as Answered? It will help the others in the community get the solution or insight easier if they face the same problem as yours. Thank you.

Best Regards

Anonymous
Not applicable

Hi @Anonymous ,

If my understanding is correctly, it seems that you would like to create a calculated column to get a dynamic date value. If yes, I'm afraid that it can't be achievable... As the value of a calculated column is computed during data refresh and uses the current row as a context, it will not change according to the user interaction(slicer, filter, column selections etc.) in the report. Please review the following links about the difference of calculated column and measure...

Calculated Columns and Measures in DAX

Calculated Columns vs Measures

In order to get a better understanding on your requirement and give you a suitable solution or workaround, could you please provide some raw data in your table (exclude sensitive data) with Text format, your visual Fields settings and your expected result with backend logic and special examples? It would be helpful to find out the solution. You can refer the following links to share the required info:

How to provide sample data in the Power BI Forum

How to Get Your Question Answered Quickly

And It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

How to upload PBI in Community

Best Regards

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.