Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Hello,
I have temperature values coming every 15 minutes (two columns - value and time). Is it possible to create a measure that calculates the average Hourly, Daily, Weekly, Monthly and somehow incorporated into a slicer that would control a line chart?
I created separate columns for date time (Hour, Day, Week and Month), but I have troubles creating a measure that will calculate the average depending on the slider.
Any help/direction would be much appreciated.
Regards,
Laurent
Solved! Go to Solution.
So you would like to have the x-axis to change depending on the value chosen in the slicer? As far as I know a measure cannot be set on the axis.
One solution could be using bookmarks instead. Create the four charts for each time period above eachother and use buttons assigned with bookmarks to toggle between the charts.
Hi Laurent,
Maybe something like this?
Avg Temp Dynamic =
SWITCH(
TRUE();
SELECTEDVALUE('Calculation'[Calculation]) = "Hourly"; [Avg Temp Hourly];
SELECTEDVALUE('Calculation'[Calculation]) = "Daily"; [Avg Temp Daily];
SELECTEDVALUE('Calculation'[Calculation]) = "Weekly"; [Avg Temp Weekly]
)
In this case I created a table with the different alternatives to choose between the calculations. Then I've created the different measures seperately for each calculation and just referenced them in this dynamic measure.
Hope this helps!
@lrnt12 Please try using SWITCH and SELECTEDVALUE funtions...
Sample data and expected output will be helpful to provide an accurate solution.
Proud to be a PBI Community Champion
Hi Pattem~ I will be happy if you tell me how I can create this table with that table. THank you so much.
Thanks for the reply.
My data looks like this. Value and Datetime field is what I pull from the source.
The expected output should be a slicer that would control the line chart. When I select Daily, I should see the average value for each day.
Basically, instead of having to drill up and down on the line chart, I'd like to control this with a slicer.
I have tried using SWITCH and SELECTEDVALUE, but it doesn't seem to work. Or perhaps I haven't used it right.
Thanks,
Laurent
So you would like to have the x-axis to change depending on the value chosen in the slicer? As far as I know a measure cannot be set on the axis.
One solution could be using bookmarks instead. Create the four charts for each time period above eachother and use buttons assigned with bookmarks to toggle between the charts.
But I want to interact with the whole report . Then What I can do, for this case.?
@Anonymous ... thinking outside the box, huh? Can't belive I didn't even think about it. Thanks !!
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
118 | |
84 | |
49 | |
38 | |
28 |
User | Count |
---|---|
185 | |
73 | |
73 | |
50 | |
42 |