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,
I have a dataset of runners and times of their arrivals to checkpoints.
I need to do a pivot table, which will show average time of arrival to the checkpoint:
To create a measure like this, I used the following formula:
average2:=averagex(all('sample'[Name];'sample'[Time]);'sample'[max])
Where "max" is simply:
max:=max('sample'[Time])
Now the problem is, when I used a slicer on the runner name, it does not affect the calculation. Its prorably because of using "ALL" function, but I couldnt create a formula without it.
I also tried something like this, but didnt work like I wanted.. it just returned actual times, not averages:
average1:=AVERAGEX(VALUES('sample'[Checkpoint]);'sample'[max])
Any help appreciated 🙂
Solved! Go to Solution.
If you want show the average by runner name, you may create a measure as below.
average3 = FORMAT(averagex(ALL('sample'[Time],'Sample'[Checkpoint]),'sample'[max]),"HH:MM")
If you want to use slicer to change the average value for the table, you may use DISTINCT('Sample'[Name]) to create a slicer table first. Then you may get the table with below measure:
average2 = FORMAT(averagex(all('sample'[Name],'sample'[Time]),'sample'[max]),"HH:MM")
average4 = IF(HASONEVALUE(Slicer[Name]),[average3],[average2])
Regards,
Cherie
If you want show the average by runner name, you may create a measure as below.
average3 = FORMAT(averagex(ALL('sample'[Time],'Sample'[Checkpoint]),'sample'[max]),"HH:MM")
If you want to use slicer to change the average value for the table, you may use DISTINCT('Sample'[Name]) to create a slicer table first. Then you may get the table with below measure:
average2 = FORMAT(averagex(all('sample'[Name],'sample'[Time]),'sample'[max]),"HH:MM")
average4 = IF(HASONEVALUE(Slicer[Name]),[average3],[average2])
Regards,
Cherie
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 |
---|---|
76 | |
76 | |
56 | |
35 | |
34 |
User | Count |
---|---|
99 | |
56 | |
53 | |
44 | |
40 |