Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hello,
I am looking to create a column that creates a running total based on another calculated column. I want the running total to capture the sum of the column "Difference", and reset everytime there's a new shift introduced. Screenshot below for how I've tried to use the variable. I've also included how the "Difference" column is calculated.
Solved! Go to Solution.
Hi @JoeKulasa
You could use the following measure:
Difference2= if(HASONEVALUE('CPM 21'[shift]),[difference],sumx(ALL('CPM 21'),'CPM 21'[difference]))
Due to without your pbix file ,so I use my data as a sample,the below,[onemon] is a mesaure,so the number total is incorrect:
then use the following measure:
Jan = IF(HASONEVALUE('Table'[MATERIAL]),[onemon], SUMX(ALL('Table'),'Table'[onemon]))
Final get what I want!
Wish it is helpful for you!
Best Regards
Lucien
Hi @JoeKulasa
You could use the following measure:
Difference2= if(HASONEVALUE('CPM 21'[shift]),[difference],sumx(ALL('CPM 21'),'CPM 21'[difference]))
Due to without your pbix file ,so I use my data as a sample,the below,[onemon] is a mesaure,so the number total is incorrect:
then use the following measure:
Jan = IF(HASONEVALUE('Table'[MATERIAL]),[onemon], SUMX(ALL('Table'),'Table'[onemon]))
Final get what I want!
Wish it is helpful for you!
Best Regards
Lucien
@JoeKulasa , Try a measure like
calculate(sum('CPM 21'[difference]) , filter(allselected('CPM 21'), 'CPM 21'[Day] <= max('CPM 21'[Day])))
@amitchandak Thanks for the suggestion. No luck yet - I used your suggestion as a column and a measure and here are the results. Note the "Shift" reset does appear to work, but it looks like it's aggregating on the shift as opposed to created a running total.
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!