Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
I have a hourly price data, below is a sample:
Eventdatetime Price
7/1/2019 0:00 22
7/1/2019 1:00 24
7/1/2019 2:00 24
7/1/2019 3:00 23
7/1/2019 4:00 23
7/1/2019 5:00 25
7/1/2019 6:00 28
I created a simple line plot of price time series and I have a slicer (between dates) to control the number of days to be viewed.
Is it possible to plot, two days ( 48 hours) at a time ? Yes, I can use the slicer for this but the goal is to allow the user to select a day ( using a slicer with list of all dates) and the plot should show hourly prices for selected day and the next day.
Thanks!
Solved! Go to Solution.
Hi @anandgovindaraj ,
You need to do the following steps:
Price over 2 days = VAR SelectedDate = MAX ( DimDate[Date] ) VAR Number_of_days = 1 //Used to create number of days to show in chart if want to show 3 days number should be 2 RETURN CALCULATE ( SUM ( EventDate[Price] ); FILTER ( ALL ( EventDate[Eventdatetime].[Date] ); EventDate[Eventdatetime].[Date] >= SelectedDate && EventDate[Eventdatetime].[Date] <= SelectedDate + Number_of_days ) )
Final result below:
See attach PBIX file.
Regards,
MFelix
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em Português@anandgovindaraj solution attached, just add a simple measure as below, and create a date table for slicer.
Total Price = CALCULATE( SUM( Table1[ Price] ), DATESBETWEEN( Table1[Eventdatetime ].[Date], MIN( 'Calendar'[Date] ), NEXTDAY( 'Calendar'[Date] ) ))
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
Thanks!
Hi @anandgovindaraj ,
You need to do the following steps:
Price over 2 days = VAR SelectedDate = MAX ( DimDate[Date] ) VAR Number_of_days = 1 //Used to create number of days to show in chart if want to show 3 days number should be 2 RETURN CALCULATE ( SUM ( EventDate[Price] ); FILTER ( ALL ( EventDate[Eventdatetime].[Date] ); EventDate[Eventdatetime].[Date] >= SelectedDate && EventDate[Eventdatetime].[Date] <= SelectedDate + Number_of_days ) )
Final result below:
See attach PBIX file.
Regards,
MFelix
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em Português@anandgovindaraj solution attached, just add a simple measure as below, and create a date table for slicer.
Total Price = CALCULATE( SUM( Table1[ Price] ), DATESBETWEEN( Table1[Eventdatetime ].[Date], MIN( 'Calendar'[Date] ), NEXTDAY( 'Calendar'[Date] ) ))
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
106 | |
94 | |
77 | |
65 | |
53 |
User | Count |
---|---|
145 | |
105 | |
104 | |
90 | |
63 |