Forum Discussion

devesqdeves's avatar
devesqdeves
Icon for Helper II rankHelper II
2 years ago

Aggregate column values per Client Id in a matrix

Hello!

I am having a hard time dealing with this problem, really hope that someone can help me out.

--------------------------------------------------------------

Main goal is to be able to have a slicer with client id that filters the whole matrix , but when  not using the slicer (when the selectedvalue(clientid)=blank()), i have to see the sum approveds for all clients , per manager id.

Context:

- For each ManagerId , i have client ids that have a TotalYearApproved, depending on the client.

- My goal is to aggregate the values of the TotalYearApproved column  per client id, to be like this : 

Being all aggregated , it gives 23.

 

The values per month are aggregated correctly , but the TotalYearApproved column isnt.

So i have a matrix table :

With the measure :
AggregatedApproveds =
VAR _table = ADDCOLUMNS(
    SUMMARIZE('DW DimGlobalManagerApproved','DW DimGlobalManagerApproved'[TotalYearApproved], 'DW DimGlobalManagerApproved'[ClientId],'Date'[MonthYear]),
    "MonthY",
    CALCULATE(SUM('DW DimGlobalManagerApproved'[Approved]))
)
RETURN
sumx(_table,[MonthY])
 

------------------------------------------------------------------------------------------------------------
 If i remove the clientId, the matrix stays like this, it doenst sum the values and only shows the distinct values :

 

The TotalYearApproved column already calculated before coming to powerbi :

I dont really know what to do in this case.

Thank you all for your patience and attention,

Ricardo



16 Replies