Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Hello Power BI Community,
I'm currently working on transitioning my reports from Tableau to Power BI, and I'm facing a challenge regarding the implementation of a dynamic date period parameter.
In Tableau, I had successfully created a table visual with a date period parameter that allowed users to select different time intervals such as month, day, hour, or sub-hour. Depending on the selected interval, the table displayed data at the corresponding level of granularity.
Here's how I implemented it in Tableau:
Date Period Parameter Calculation:
```
DATE PERIOD = CASE [PERIOD]
WHEN 'MONTH' THEN [MONTH]
WHEN 'DAY' THEN [DAY]
WHEN 'HOUR' THEN [HOUR]
WHEN 'SUB-HOUR' THEN [SUB-HOUR]
END
```
**Granularity Calculations:**
```
MONTH = LEFT(STR(DATENAME('month',[Ixn Subhour Date])),3)+"-"+RIGHT(DATENAME('year',[Ixn Subhour Date]),2)
DAY = STR(DATEPART('month',[Ixn Subhour Date]))+"/"+STR(DATEPART('day',[Ixn Subhour Date]))+"/"+STR(DATEPART('year',[Ixn Subhour Date]))
HOUR = STR(datetime( str(date([Ixn Subhour Date]))+" "+str(datepart('hour',[Ixn Subhour Date]))+":"+ '00' ))
SUB-HOUR = STR(datetime( str(date([Ixn Subhour Date]))+" "+str(datepart('hour',[Ixn Subhour Date]))+":"+ right("0"+str(int(datepart('minute',[Ixn Subhour Date])/30)*30),2) ))
```
I'm now looking to replicate this functionality in Power BI. Essentially, I need to create a parameter that allows users to select the granularity of the date period (month, day, hour, or sub-hour) and dynamically adjust the table visual accordingly.
Could you please provide guidance or step-by-step instructions on how to achieve this in Power BI? Any assistance or insights would be greatly appreciated.
Thank you in advance for your help!
Best regards,
Manoj Prabhakar
Hi Manoj.
You may leverage the feature called 'Field Parameters' for this in Power BI. It works for both Dimensions and Values, including Date Columns, but do note that the feature is still in preview: Let report readers use field parameters to change visuals (preview) - Power BI | Microsoft Learn
Field Parameters allow you to create a dynamic fields, which depending on selection in a filter, will display the selected dimensions/values.
You begin by going to the Modeling Tab in Power BI Desktop, and select New Parameter -> Fields:
Next, choose any number of Columns of any format you wish to add to the parameter:
Finally, add a Slicer visual to your report with the Parameter as its Field, and put the Parameter into any other visualization you want. Here I added it to a table:
Happy report building!
_____________________________________________________
I hope my comment was helpful.
If your question was answered, please mark your post as 'Solved' and consider giving me a 'Thumbs Up'.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
81 | |
76 | |
61 | |
37 | |
33 |
User | Count |
---|---|
99 | |
56 | |
51 | |
42 | |
40 |