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 dataset with three columns as follows. i want to first grouped data by two columns day and bucket and sum over values and second calculate average and max of sums over buckets. I would appreciate if you can help me to figure this out by adding a measure to my table to calculate this.
day | bucket | value |
1/1/2023 | 1 | 10 |
1/1/2023 | 1 | 20 |
1/1/2023 | 2 | 5 |
1/1/2023 | 2 | 15 |
1/2/2023 | 1 | 30 |
1/2/2023 | 1 | 10 |
1/2/2023 | 2 | 25 |
1/2/2023 | 2 | 5 |
day | bucket | value |
1/1/2023 | 1 | 30 |
1/1/2023 | 2 | 20 |
1/2/2023 | 1 | 40 |
1/2/2023 | 2 | 30 |
bucket | value | |
1 | 35 | |
2 | 25 | |
bucket | value | |
1 | 40 | |
2 | 30 |
Solved! Go to Solution.
Can you try this measures?
1. Average
Average =
VAR _temp = SUMMARIZE(
Test_max_avg,
Test_max_avg[day],
Test_max_avg[bucket],
"@Value",SUM(Test_max_avg[value]))
VAR _result = AVERAGEX(_temp,[@Value])
RETURN _result
2. Max
Max =
VAR _temp = SUMMARIZE(
Test_max_avg,
Test_max_avg[day],
Test_max_avg[bucket],
"@Value",SUM(Test_max_avg[value]))
VAR _result = MAXX(_temp,[@Value])
RETURN _result
Result:
Thanks,
Arul
Thank you so much Arul, it works.
I want to use bucket in x axis and average and max in y axis of a line chart.
Can you try this measures?
1. Average
Average =
VAR _temp = SUMMARIZE(
Test_max_avg,
Test_max_avg[day],
Test_max_avg[bucket],
"@Value",SUM(Test_max_avg[value]))
VAR _result = AVERAGEX(_temp,[@Value])
RETURN _result
2. Max
Max =
VAR _temp = SUMMARIZE(
Test_max_avg,
Test_max_avg[day],
Test_max_avg[bucket],
"@Value",SUM(Test_max_avg[value]))
VAR _result = MAXX(_temp,[@Value])
RETURN _result
Result:
Thanks,
Arul
In which visualization you want to show this and what are the columns that you are going to use in the visualization?
Thanks,
Arul
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 |
---|---|
107 | |
97 | |
75 | |
63 | |
53 |
User | Count |
---|---|
139 | |
100 | |
95 | |
85 | |
63 |