To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
I am looking to create a rolling sum of the below table. For example, the new measure would be $390,170 for first row, then 834,590 for the second row. The measure should function and "re-rank" based on the relationship names within the view (filtered)
Amount is a calculated measure performing average of a calculated column (rate * total amount) minus a single filtered relationship name as the base value.
Hi , @Reisae
According to your description, you want to get the rolling of the [Amount] sort by the filtered [Relationship Name].
For your need , i recommand you to use the slicer to filter the [Relationship Name] so that we can use the ALLSELECTEED() function to get the filter .
Here are the steps you can refer to :
(1)This is my test data, i create a [Amount] measure to simulate your situation.
(2)Then we can create a measure like this:
Rolling Measure = var _t = ADDCOLUMNS( ALLSELECTED('Table'[Relationship Name]) , "Amount" , [Amount] )
var _t2 = ADDCOLUMNS(_t , "flag" ,RANK(DENSE,_t,ORDERBY([Amount],ASC,[Relationship Name],ASC)) )
var _cur_Name= VALUES('Table'[Relationship Name])
var _cur_falg =MAXX( FILTER(_t2 , [Relationship Name] in _cur_Name) , [flag])
return
SUMX(FILTER( _t2 ,[flag] <= _cur_falg) , [Amount])
(3)Then we can put the fields we need on the visual and we can get the result as follows:
And when we filter on the slicer , it will also work .
Thank you for your time and sharing, and thank you for your support and understanding of PowerBI!
Best Regards,
Aniya Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Please provide sample data (with sensitive information removed) that covers your issue or question completely, in a usable format (not as a screenshot). Leave out anything not related to the issue.
https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...
Please show the expected outcome based on the sample data you provided.
https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...
User | Count |
---|---|
14 | |
11 | |
6 | |
6 | |
5 |
User | Count |
---|---|
29 | |
17 | |
11 | |
7 | |
5 |