Forum Discussion
MattiaMaetini
Helper I
2 years agoDAX cumulate SUM issue
Hi all, I have a problem with this DAX code: my goal is to produce a cumulate sum starting from a fact table (FORNITORI_F). 1) SommaImporti: I group by FK_ID_ANAGFORNITOREAGGREGATO, sum Import and ...
- Anonymous1 year ago
Hi MattiaMaetini ,
Try this
Total = VAR _FK_ID = SELECTEDVALUE('Table'[FK_ID Fornitore Aggregato]) VAR _table =SUMMARIZE(ALL('Table'),[FK_ID Fornitore Aggregato],"Sum_Importo",[SumImporto]) VAR _table2 = ADDCOLUMNS(_table,"Rank",RANKX(_table,[Sum_Importo],,DESC,Skip)) VAR _Rank = [Ranking] VAR _total = SUMX(FILTER(_table2,[Rank] <=_Rank),[Sum_Importo]) RETURN _totalBest Regards,
Wenbin Zhou
MattiaMaetini
Helper I
2 years agoAny suggest?