Cumulative sum from one column based on first value from another

Hi guys,

I am new here and need help.

I have large dataset (millions of rows) with about 20 columns, but it will be much easier to explain my problem with only 3 variables: Date, Metric, Value.

I have two variables in column Metric, Lets say A and B, and I need to take take first (sum for first day) values from “A” plus first sum o values for “B”, than continue adding sum of values for B each day.

To make long story short, I need sum of values for “A” for 01.01.2023 as baseline, then runnig total for sum of values for “B”.

What I have
image

What I need
image

I know how to calculate running total for “B”, but I can´t “link” it to value A (calculate(sum), filter(Metric=“A”), date=date(01.01.2023).

Any suggestions?

Thank you.

Best regards,

Martin

Hi @MartinVadura

Add a date table
Create a Measure Sum of Values = sum (“nameofTable”(Value))

create a visual with two column
Date(datetable) Sum of Values

the sum value will be display by date (days)

I would suggest you review the Beginners Guide to Power BI video

I hope this helps.

thanks
Keith

Hi Keith,

Thanks for reply, I am sorry about confusion, I messed up, little bit.

Simple sum will not help at all. There are values for “A” every day, I need only first one (01.01.2023). Thats where I am lost. If I filter with calculate, I can sum A+B only for 01.01.2021 but not for next day, day after and so on.

B = CALCULATE(SUM(Dotaz1[MetricValueDaily]), FILTER(Dotaz1,Dotaz1[Metric]=“EOP”),FILTER(Dotaz1, Dotaz1[CalendarDate]=DATE(2021,01,01)))

What I need to change to have value from 01.01.2021 in all day till today?

BR,

Martin

sorry i read it wrong too

review this from Microsoft

Cumulative Total/ Running Total in Power BI - Power BI Docs

Cumulative Total/ Running Total in Power BI - Power BI Docs

Also here is some courses you can review

thanks
Keith