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
Hi there! I need your help in solving a problem
I need to show unit cost by a particular month and by accumulating several month. It is ok when I choose only one month, but when I want to accumulate data for several months it just summarize unit cost. For example, if unit cost for first month is 2 unit and for the second month is 3 unit, when I combine those month together (1+2) instead of showing 2,5 it shows the sum of theese two figures - 5. What dax function should I use to make it right? Thanks
Here is my pbix example file
Thanks in advance
Solved! Go to Solution.
Hi @DauletKali ,
You can use the following measure to calculate accumulating unit cost:
AccumulatingUnCost = CALCULATE(SUM(Actual[ActualUnCost]),FILTER(ALL(Data),MONTH(Data[Date])<=MONTH(MAX(Data[Date])) && YEAR(Data[Date]) = YEAR(MAX(Data[Date]))))
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Best Regards,
Dedmon Dai
Hi @DauletKali ,
You can use the following measure to calculate accumulating unit cost:
AccumulatingUnCost = CALCULATE(SUM(Actual[ActualUnCost]),FILTER(ALL(Data),MONTH(Data[Date])<=MONTH(MAX(Data[Date])) && YEAR(Data[Date]) = YEAR(MAX(Data[Date]))))
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Best Regards,
Dedmon Dai
@DauletKali , You can get rolling like this but with a date table
Rolling 12 = CALCULATE(Divide(sum(Table[Revenue]),Sum(Table[Unit])),DATESINPERIOD('Date'[Date],ENDOFMONTH(Table[Date]),-12,MONTH))
Rolling 12 = CALCULATE(Divide(sum(Table[Revenue]),Sum(Table[Unit])),DATESINPERIOD('Date'[Date ],MAX(Table[Date]),-12,MONTH))
Rolling 12 = CALCULATE(Divide(sum(Table[Revenue]),Sum(Table[Unit])),DATESINPERIOD('Date'[Date ],MAX('Date'[Date ]),-12,MONTH))
hi @DauletKali - Apologies I am unable to understand the field names in your sample file.
But if you are using the unit price column directly in a visual - you should be able to select that the field should not be summarized as seen in the below screen grab.
Please mark the post as a solution if my comment helped with solving your issue. Thanks!
Proud to be a Super User!
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!