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

Preparing for a certification exam? Ask exam experts all your questions on May 15th. Register now.

Reply
Anonymous
Not applicable

How to create monthly and daily option for the slicer for the dataset

Hi, 

 

I tried to create but finding errors during the process.

 

I just want to have monthly and daily view in the slicer option and change the bar chart value accordingly.

 

I have provided the sample pbix file here:
https://drive.google.com/file/d/10qcIzZVvGWvBe0YtONw_wXdFMkgw2lTl/view?usp=sharing

 

I need something similar to this:

nishad1092_0-1689825202622.png

 

 

 


Please kindly let me know of the solution, It will be a great support, as I'm very new to Power BI.

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

 

According to your description, here are my steps you can follow as a solution.

(1) My test data is the same as yours.

(2) We can create calculated columns.

Month = MONTH('TotalEnergy'[LocalSystemDate])
Day = DAY('TotalEnergy'[LocalSystemDate])Day = DAY('TotalEnergy'[LocalSystemDate])

(3) Create a field parameter and then the result is as follows.

vtangjiemsft_0-1690251258310.pngvtangjiemsft_1-1690251274893.png

Best Regards,

Neeko Tang

If this post  helps, then please consider Accept it as the solution  to help the other members find it more quickly. 

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Hi @Anonymous ,

 

According to your description, here are my steps you can follow as a solution.

(1) My test data is the same as yours.

(2) We can create calculated columns.

Month = MONTH('TotalEnergy'[LocalSystemDate])
Day = DAY('TotalEnergy'[LocalSystemDate])Day = DAY('TotalEnergy'[LocalSystemDate])

(3) Create a field parameter and then the result is as follows.

vtangjiemsft_0-1690251258310.pngvtangjiemsft_1-1690251274893.png

Best Regards,

Neeko Tang

If this post  helps, then please consider Accept it as the solution  to help the other members find it more quickly. 

Anonymous
Not applicable

Thank you @Anonymous  I wanted this solution.

amitchandak
Super User
Super User

@Anonymous , One way is to create measures and use a field parameter. You can rename the name is field parameters

 

If you need with date selection use independent date table in slicer

 

12 month trend

//Date1 is independent Date table, Date is joined with Table
new measure =
var _max = maxx(allselected(Date1),Date1[Date])
var _min = eomonth(_max, -12) +1
return
calculate( sum(Table[Value]), filter('Date', 'Date'[Date] >=_min && 'Date'[Date] <=_max))

 

 

or

30 Day trend

//Date1 is independent Date table, Date is joined with Table
new measure =
var _max = maxx(allselected(Date1),Date1[Date])
var _min =  _max - 30
return
calculate( sum(Table[Value]), filter('Date', 'Date'[Date] >=_min && 'Date'[Date] <=_max))

 

 

If you not selecting date from slicer

this can work

new measure =
var _max = maxx(allselected(Date),Date[Date])
var _min = eomonth(_max, -12) +1
return
calculate( sum(Table[Value]), filter('Date', 'Date'[Date] >=_min && 'Date'[Date] <=_max))
Need of an Independent Date Table:https://www.youtube.com/watch?v=44fGGmg9fHI

 

another way

https://medium.com/chandakamit/power-bi-when-i-felt-lazy-and-i-needed-too-many-measures-ed8de20d9f79

 

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Hi @amitchandak 

Thank you very much for the support.

Just wanted to know, If you have already tried this with the pbix file I shared, Could you reshare it with me please. It will be easier for me.

Helpful resources

Announcements
PBIApril_Carousel

Power BI Monthly Update - April 2025

Check out the April 2025 Power BI update to learn about new features.

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

April2025 Carousel

Fabric Community Update - April 2025

Find out what's new and trending in the Fabric community.