The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
I need to calculate an accumulated sum and use the accumulated value for the current month as a variable to add the value column for the other previous months. Example:
Mês | Valor | Acumulado | Resultado |
Janeiro | 10 | 10 | 80+10=90 |
Fevereiro | 10 | 20 | 80+20=100 |
Março | 10 | 30 | 80+30=110 |
Abril | 10 | 40 | 80+40=120 |
Maio | 10 | 50 | 80+50=130 |
Junho | 10 | 60 | 80+60=140 |
Julho | 10 | 70 | 80+70=150 |
Agosto | 10 | 80 | 80+80=160 |
Setembro | 10 | 90 | 80+90=170 |
Outubro | 10 | 100 | 80+100=180 |
Novembro | 10 | 110 | 80+110=190 |
I created a measurement to return the value for the month of August, but when I put the measurement on the graph, I have the result below.
Mês | Valor | Acumulado | Resultado |
Janeiro | 10 | 10 | 10+10 =20 |
Fevereiro | 10 | 20 | 10+20=30 |
Março | 10 | 30 | 10+30=40 |
Abril | 10 | 40 | 10+40=50 |
Maio | 10 | 50 | 10+50=60 |
Junho | 10 | 60 | 10+60=70 |
Julho | 10 | 70 | 10+70=80 |
Agosto | 10 | 80 | 10+80=90 |
Setembro | 10 | 90 | 10+90=100 |
Outubro | 10 | 100 | 10+100=110 |
Novembro | 10 | 110 | 10+110=120 |
I need the accumulated value of the current month (August) to add with the value column for each month.
can you help me?
Solved! Go to Solution.
HI @Anonymous ,
Create an index column in Power Query
Then create these Calculated Columns
Ac = SUMX(FILTER('Table','Table'[Index] <= EARLIER('Table'[Index])),'Table'[Valor])
RE =
var Augusto = SUMX(FILTER('Table','Table'[Mês] = "Agosto"),'Table'[Ac])
RETURN
Augusto + 'Table'[Ac]
Regards,
Harsh Nathani
Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)
HI @Anonymous ,
Create an index column in Power Query
Then create these Calculated Columns
Ac = SUMX(FILTER('Table','Table'[Index] <= EARLIER('Table'[Index])),'Table'[Valor])
RE =
var Augusto = SUMX(FILTER('Table','Table'[Mês] = "Agosto"),'Table'[Ac])
RETURN
Augusto + 'Table'[Ac]
Regards,
Harsh Nathani
Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)
Hi @Anonymous ,
Not very clear.
Can you share the expectd output?
Regards,
Harsh Nathani
Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)
User | Count |
---|---|
14 | |
11 | |
8 | |
6 | |
5 |
User | Count |
---|---|
28 | |
19 | |
13 | |
8 | |
5 |