Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Thimma_pbi
Helper I
Helper I

Need help in DAX

Hi,

 

I have below table. I don't have Previous Day column and wanted create Total Value column as per the below table. Is it possible to get that. The first date in a month I wanted to pass as zero for Previous day value. And the same should applies if I have multiple Sr No's (Product Line, Product Line 2 and so on....

 

Any help in DAX?

 

Sr NoDateABCPrevious Day ValueTotal Value
Product Line 101-Jan-24203040020+30+40+0 (This zero value is default at the starting day of a month . So total value should be 90
Product Line 102-Jan-2413435 13+43+5+90 (This 90 value is nothing but previous day). So total value should have 151
Product Line 103-Jan-24183022 18+30+22+151 (This 151 value is nothing but previous day value. So total value should be  221
11 REPLIES 11
Thimma_pbi
Helper I
Helper I

No, data needed in that format only. thanks

Create a calculated column that adds up A, B and C. Create a running total quick measure over that column 

No, as I mentioned need day wise that calculated column Total Value.

lbendlin_1-1724847733577.png

 

lbendlin_0-1724847713677.png

 

lbendlin_2-1724847757931.png

 

 

No, the previous day values I am using it for comparison purpose not for adding. so running will not work.

It is not clear to me what your desired output is. Please elaborate.

actually the formula for Total Value is SUM(A+B+C-(Targetvalue-Previousdayvalue). For 1st day of month previous value is zero as a static value passing. whatever value I am getting that value should pass it on 2nd day total value.

 

For 2nd day the Total value is SUM(A+B+C -(Targetvalue-1stdayTotalvalue).

2nd day, 1stdayTotalvalue will become previousday value for 2nd day.

 

For 3rd day  total value is SUM(A+B+C-(Targetvalue-2ndtotalvalue).

3rd day, 2nd day Total Value will become previousday value for 3rd day..

and so on.

 

 

My proposal produces the same result, but in a simplified manner, without the need for intermediate columns.

What will happen if 4th day get Totalvalue as zero, then I should be doing Targetvalue-Previous day value (then my previous day value shouldn't be running sum, I should pass as zero. that scenario will get failed above solution.

You cannot do conditional aggregations in DAX. They are only possible in Power Query.

 

Please provide sample data that fully covers your issue.
Please show the expected outcome based on the sample data you provided.

lbendlin
Super User
Super User

Unpivot your A, B and C columns to bring them into a usable format. Then use a "Running Total"  Quick measure.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors