The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hello,
So I am noy yet very strong in aggregating data, my Dax is slowly getting better, but I am a bit stuck.
I have this table:
id | date | activity | activity_count |
308 | 1-Jun-22 | a | 312 |
308 | 1-Jun-22 | c | 39 |
308 | 1-Jun-22 | b | 80 |
308 | 2-Jun-22 | c | 251 |
308 | 2-Jun-22 | b | 222 |
308 | 3-Jun-22 | a | 50 |
308 | 3-Jun-22 | c | 223 |
308 | 3-Jun-22 | b | 171 |
308 | 4-Jun-22 | b | 302 |
308 | 4-Jun-22 | c | 106 |
308 | 4-Jun-22 | a | 23 |
I would like to create a measure or seperate table / aggregation:
308 is the id (one of many ids), and per day a number is recorded for 3 activities. I would like to get a similar table or measure that sums of the 3 activities (a, b and c) per day, per id. Example: so for day / date 1-Jun-22 the sum is 312+39+80 = 431 ...... and then repeated per day all the way through.
Cheers,
Carsten
Solved! Go to Solution.
Thanks a lot for the reply / solution. In the end I have created an aggregated table, as I was requested to do more data quality measures. Sorry for the late reply. Cheers, Carsten
Thanks a lot for the reply / solution. In the end I have created an aggregated table, as I was requested to do more data quality measures. Sorry for the late reply. Cheers, Carsten
@Anonymous , I think simple Measure sum should do
Sum(Table[activity_count])
or in case you need to ignore row context
calculate(Sum(Table[activity_count]) , filter( alllselected(Table), Table[id] = max(Table[ID]) && Table[date] = max(Table[date]) ))
User | Count |
---|---|
28 | |
10 | |
8 | |
6 | |
5 |
User | Count |
---|---|
33 | |
13 | |
12 | |
9 | |
7 |