Forum Discussion
Spread total over rows
- 5 years ago
Hi, paulfink
Based on your description, I created data to reproduce your scenario. The pbix file is attached in the end.
Table:
Value(Measure):
Value = var _pro = SELECTEDVALUE('Table'[Project]) var _task = SELECTEDVALUE('Table'[Task]) return SWITCH( _pro, 1, SWITCH( _task, "A",10, "B",15, "C",20 ), 2, SWITCH( _task, "A",5, "B",10, "C",15 ) )You may create a measure like below.
Desired = var tab = SUMMARIZE( ALL('Table'), 'Table'[Project], 'Table'[Task], "Value", var _pro = 'Table'[Project] var _task = 'Table'[Task] return SWITCH( _pro, 1, SWITCH( _task, "A",10, "B",15, "C",20 ), 2, SWITCH( _task, "A",5, "B",10, "C",15 ) ) ) return SUMX( FILTER( tab, [Project]=SELECTEDVALUE('Table'[Project]) ), [Value] )Result:
Best Regards
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
paulfink , where is date,
It should be like
Sub Total = CALCULATE(SUM('Table1'[Value]), ALLEXCEPT('Table1', 'Table1'[Project]))
amitchandak I have already tried that and it does not work.
I need the value to be a measure so please reference it as Value1.
- amitchandak5 years agoSuper User
paulfink ,
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.
- paulfink5 years agoPost Patron
amitchandak there is already an example in my post
- amitchandak5 years agoSuper User
paulfink , That is an image. Not the fastest way. I need to create data myself?