The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
I guys, i have a table lake this
Data | value | index |
x | 10 | 1 |
x | 30 | 2 |
x | 60 | 3 |
i want create another column with this logic
data | value | index | calculate | result |
10 | 1 | 10 | 10 | |
30 | 2 | 10+30=40 | 40 | |
60 | 3 | 40+60=100 | 100 | |
20 | 4 | 100+20=120 | 120 |
i try this solution and works for power bi desktop
CALCULATE(SUM('Table3'[Value]),FILTER('Table3','Table3'[index]<=EARLIER('Table3'[index])))
but when i create on web version of power by the earlier function give me 'dax earlier parameter is not the correct type'
Reading online i understood that earlier shouldn't be used in this situation, but i can't transform my dax expression to make it work differently, could you give me some advice?
Solved! Go to Solution.
@jc173 Nope. Previous Value (“Recursion”) in DAX - Microsoft Fabric Community
Hi @lbendlin ,
I modified my formula, you can try calculated column or measure like below:
Measure =
var cur = MAX('Table'[index])
return
SUMX(FILTER(ALL('Table'),'Table'[index] <= cur),'Table'[value])
Column =
var cur = 'Table'[index]
return
SUMX (
FILTER ( 'Table', 'Table'[index] <= cur ),
'Table'[value]
)
Best Regards,
Adamk Kong
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @lbendlin ,
I modified my formula, you can try calculated column or measure like below:
Measure =
var cur = MAX('Table'[index])
return
SUMX(FILTER(ALL('Table'),'Table'[index] <= cur),'Table'[value])
Column =
var cur = 'Table'[index]
return
SUMX (
FILTER ( 'Table', 'Table'[index] <= cur ),
'Table'[value]
)
Best Regards,
Adamk Kong
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @jc173 ,
You can try formula like below:
Column =
SUMX (
FILTER ( 'Table', 'Table'[index] <= EARLIER ( 'Table'[index] ) ),
'Table'[value]
)
Best Regards,
Adamk Kong
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
stop it with the EARLIER already, that is not good advice.
This is a running total that can be covered via quick measures.
@jc173 Nope. Previous Value (“Recursion”) in DAX - Microsoft Fabric Community
User | Count |
---|---|
28 | |
12 | |
8 | |
7 | |
5 |
User | Count |
---|---|
35 | |
14 | |
12 | |
9 | |
7 |