Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
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:
Solved! Go to Solution.
Thanks @v-yiruan-msft 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.
Thanks @v-yiruan-msft 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.
Hi @allison_t ,
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
Hi @allison_t ,
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
User | Count |
---|---|
98 | |
90 | |
84 | |
70 | |
67 |
User | Count |
---|---|
113 | |
104 | |
101 | |
73 | |
65 |