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.
Hey guys!
I need a new column where it sums each instance of eash person.
I have a table like this:
ID Number
1 5
2 3
3 4
1 2
1 3
2 1
And I need something like this:
ID | Number | Calculated Column
1 5 10
2 3 4
3 4 3
1 2 10
1 3 10
2 1 4
The biggest problem is: there is another column where I have an exclusive identifier (it's used to relate to another table), for each row, so differentes instances of the ID 1 have different identifiers. My final goal is to find how many different people have Calculated Column > 5.
Can anyone help me?
Solved! Go to Solution.
Hi @FelipePalomino ,
Try this code for a column:
CALCULATE(SUM(TABLE[Number]); FILTER(TABLE; TABLE[ID] = EARLIER(TABLE[ID]))
In your measure, count it as distinct id where this column is > 5.
@FelipePalomino , try a new column like
SUMX(FILTER(TABLE, TABLE[ID] = EARLIER(TABLE[ID]),TABLE[Number]))
or a new measure
calculate(SUM(TABLE[Number]),allexcept(TABLE[ID] ))
Hi @FelipePalomino ,
Try this code for a column:
CALCULATE(SUM(TABLE[Number]); FILTER(TABLE; TABLE[ID] = EARLIER(TABLE[ID]))
In your measure, count it as distinct id where this column is > 5.
Thanks!!
It worked just fine!
I have never used this "earlier" before, so you solved the problem and I learned something new. 🙂
User | Count |
---|---|
82 | |
81 | |
37 | |
34 | |
31 |
User | Count |
---|---|
94 | |
80 | |
60 | |
50 | |
49 |