Forum Discussion
Sum the Unique values to appropriate value
- 1 year ago
Kopec - You can use the below to get your desired answer (just change the column names):
VAR _table = SUMMARIZE( 'Table', 'Table'[Column1], 'Table'[Column2] ) RETURN SUMX( _table, 'Table'[Column2])If this works for you please accept as the solution to help others with the same challenge.
- Anonymous1 year ago
Hi Kopec
The formula i offered can work in power pivot.
Best Regards!
Yolo Zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Mark,
ist look great, but I need to get value for every row in the table. According to the picture (column "RESULT"):
- Anonymous1 year agoNot applicable
Hi,
Thanks for the solution mark_endicott and DataNinja777 offered, and i want to offer some more information for user to refer to.
hello Kopec , mark_endicott 's solution is right, you can use it as a calculated column .
Column = VAR a = SUMMARIZE ( 'Table', [Column1], [Column2] ) RETURN SUMX ( FILTER ( a, [Column1] = EARLIER ( 'Table'[Column1] ) ), [Column2] )Output
Best Regards!
Yolo Zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- mark_endicott1 year ago
Super User
Anonymous - Thank you, I always forget about calculated columns! Can I request we mark my solution please as this one is solved!
- Kopec1 year ago
Helper I
Hi,
for Power BI it works great.
Can anybody help me how to make it work in Power Pivot?
And can anybody know, why the below formula doesnt work?=CALCULATE (SUMX(TABLE; Column B);VALUES(Column B); ALLEXCEPT(TABLE; Column A)
)
- Anonymous1 year agoNot applicable
Hi Kopec
The formula i offered can work in power pivot.
Best Regards!
Yolo Zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- mark_endicott1 year ago
Super User
Kopec - As far as I'm aware this will be nearly impossible in a measure due to the way Power BI groups identical rows in it's visualisations. Even if you add an index column to undo the grouping, there will still be an issue with the way we have to use SUMMARIZE to remove the row duplication to get the result you want.
There may be a solution out there for you but I've tried a few, including adding a duplicate of the table, and none seem to work.I suggest you think about why it is necessary to present your data in this way, and if the solution I have provided works, or use Excel.