Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hi,
I have a data like in the table below:
On my chart I want to aggregate them like in the table below:
1. I want to show only values where the sum < 0
2. Divide the sum/total to present the result as a contribution
3. Be able to filter by other columns
Right now I have only DAX which helps me get the elements where the value is bigger than zero:
CALCULATE(SUM('Table'[Measure]),
FILTER(ALL('Table'[Measure]),
SUM('Table'[Measure]) < 0))
Could you help me with this, please?
Thank you in advance!
Solved! Go to Solution.
Hi @lokosrio
could you try to write your measures like this:
Total =
VAR _tmp =
SUMMARIZE (
FILTER (
ADDCOLUMNS (
CALCULATETABLE ( VALUES ( 'Table'[Dimension 1] ), ALL ( 'Table'[Dimension 1] ) ),
"t", CALCULATE ( SUM ( 'Table'[Amount] ) )
),
[t] < 0
),
'Table'[Dimension 1]
)
RETURN
CALCULATE (
SUM ( 'Table'[Amount] ),
FILTER ( ALL ( 'Table'[Dimension 1] ), 'Table'[Dimension 1] IN _tmp )
)
and
Contribution = divide(sum('Table'[Amount]),[Total])
Cheers,
Sturla
If this post helps, then please consider Accepting it as the solution. Kudos are nice too.
User | Count |
---|---|
140 | |
113 | |
104 | |
76 | |
63 |
User | Count |
---|---|
135 | |
126 | |
110 | |
70 | |
61 |