Forum Discussion
Need Help with Creating a Dynamic Slicer in Power BI
- 2 years ago
Hi,
I created the custom column in power query, all of the rolling time categories are available in my date dimension, all of these rolling categories are updated daily in my warehouse.
You could do something very rudimental such as:
Consider your Date table if you have rolling integer columns identifying your months you could create a new column in your table.
The date table:
Month Rolling Month Number
Jan -5
Feb -4
March -3
April -2
May -1
June 0
July 1
Aug 2
so on...
Custom column would do something such as
If(Rolling Month Number = 0, "Reporting Month", Month)
You can deploy your report with Reporting Month selected (on your slicer), the report will always filter to the current month. (Assuming you have integer columns - these would need to be updated daily)
Your slicer could end up looking something like this.
Hi John,
Thank you for your solution.
I'm currently using the following calculation for Rolling Month Number:
Rolling Month Number =
VAR CurrentDate = MIN('Date'[Refresh_Date])
VAR CurrentMonth = MONTH(CurrentDate)
VAR CurrentYear = YEAR(CurrentDate)
VAR DateMonth = MONTH('Date'[Refresh_Date])
VAR DateYear = YEAR('Date'[Refresh_Date])
RETURN
(CurrentYear - DateYear) * 12 + CurrentMonth - DateMonth
Could you please guide me on how to proceed with creating the custom column based on this calculation? Also, I'm unclear about how the filtering process would function using the "Reporting Month" approach you mentioned. Could you elaborate on that as well?
Thanks again for your assistance.
Regards,
Akshata
- ajohnso22 years agoSolution Supplier
Hi,
I created the custom column in power query, all of the rolling time categories are available in my date dimension, all of these rolling categories are updated daily in my warehouse.
You could do something very rudimental such as: