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.
Hi,
I have a measure that needs to be averaged and operated on at a row level. From this forum, it seems that the below is the correct syntax for the 'average' of a measure
ValueAVerage = CALCULATE([Value], ALLSELECTED('Table'[Date])
This works on a matrix level, however when trying a cumulative sum function for each date, it reverts back to the value for that date alone. This is because ALLSELECTED is referring only to the current date I guess? Though basic operators work (+/-). See below chart.
Date | Value | ValueAverage | CumulSum (what does show) | Cumulsum (what should show) |
1 | 9 | 6 | 9 | 6 |
2 | 2 | 6 | 11 | 12 |
3 | 7 | 6 | 18 | 18 |
I'm using the below as a basic cumulative sum function, nothing special:
I've also tried the below to no avail
I need to have the average of the entire measure, and have each row calculate by that average. How do I do this?
Solved! Go to Solution.
Hi @AlexH330 ,
Please refer these measures.
Measure = CALCULATE(AVERAGE('Table'[Value]),ALL('Table'))
Measure 2 = SUMX(FILTER(ALLSELECTED('Table'),'Table'[date]<=MAX('Table'[date])),[Measure])
Best Regards,
Jay
Hi @AlexH330 ,
Please refer these measures.
Measure = CALCULATE(AVERAGE('Table'[Value]),ALL('Table'))
Measure 2 = SUMX(FILTER(ALLSELECTED('Table'),'Table'[date]<=MAX('Table'[date])),[Measure])
Best Regards,
Jay
@amitchandak clever! that almost worked. However there is 1 pressing issue:
1. When the series is consistent (ie has the same number for multiple days) the sum works correctly. When that value changes within the series, the sum actually subtracts, but it subtracts a random number. After that, the series sums correctly again. See below, date 4 is incorrect (sorry for the formatting, I get an HTML error on these boards)
Date Value CumulSum
1 2 2
2 2 4
3 2 6
4 3 5
5 3 8
Any idea what's going on here?
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 |
---|---|
84 | |
75 | |
68 | |
41 | |
35 |
User | Count |
---|---|
102 | |
56 | |
52 | |
46 | |
40 |