'How can I get total amount value for each different user in PowerBI

I want sum all 308 values in userprofileid column to get the total amount of the values for that user in the amount column
This image shows GROUPBY(userprofileid, amount)

enter image description here

My goal:

308    664,878


Solution 1:[1]

You can create a Measure as below-

total = sum(table_name[amount])

now add userprofileid and newly created measure Total to a table visual and you will get your desired output.

But, if you need only sum for profile 308, you need something as below-

Total_308_ = 
calculate(
    sum(table_name[amount]),
    filter(
        ALL(table_name),
        table_name[userprofileid] = 308
    )
)

Solution 2:[2]

If you need a measure

Measure =
SUMX ( VALUES ( 'Table'[userpofileid] ), SUM ( 'Table'[amount] ) )

If you need a table

tbl =
GROUPBY (
    'Table',
    'Table'[userpofileid],
    "amount", SUMX ( CURRENTGROUP (), 'Table'[amount] )
)

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 mkRabbani
Solution 2 smpa01