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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
blackgold
Regular Visitor

Daily Values from Running Total

Hello,

 

I am attempting to get daily values from the running total.
I have three columns Key, Date, Cumulative Cases. I am trying to get the daily values per key.

I have attached a picture from excel of what i am trying to do in PowerBI. However, I can not do it on excel because the data has over 3 million rows. 

 

blackgold_0-1667169194658.png

Keeping the performance in mind, which will better DAX or power query?

 

Update

I have come up with a solution which works with a sample dataset but when I try it with the actual dataset the DAX formula stays on "working on it".

blackgold_0-1667177304761.png

 

I appreciate the help.

Thank you!

 

 

 

8 REPLIES 8
aj1973
Community Champion
Community Champion

@blackgold 

Definetly DAX is your best option 

Regards
Amine Jerbi

If I answered your question, please mark this thread as accepted
and you can follow me on
My Website, LinkedIn and Facebook

VahidDM
Super User
Super User

Hi @blackgold 

 

Can you post sample data as text not image to be able to copy/paste that?

Appreciate your Kudos!!
LinkedIn:www.linkedin.com/in/vahid-dm/

 

KeyDateCumulative Cases
Baldwin, Alabama4/10/202264
Baldwin, Alabama4/11/202270
Baldwin, Alabama4/12/202275
Baldwin, Alabama4/13/202282
Autaga, Alabama4/10/202218
Autaga, Alabama4/11/202219
Autaga, Alabama4/12/202219
Autaga, Alabama4/13/202220
Tyler, Texas4/10/202287
Tyler, Texas4/11/202289
Tyler, Texas4/12/202295
Tyler, Texas4/13/2022102

 

Hello @VahidDM,

I have updated the question. 
I come up with solution but it is only working on the sample dataset. When I use the same DAX formula on the actual dataset, PowerBI is stuck on working on it. 
What will suggest on optimizing the DAX formula?
Thank you!

aj1973
Community Champion
Community Champion

@blackgold 

Why not using it as a Measure instead of a calculated column. The DAX will work just fine into a measure.

Regards
Amine Jerbi

If I answered your question, please mark this thread as accepted
and you can follow me on
My Website, LinkedIn and Facebook

I tired that and I get an error saying:

 

A single value for column 'Key' in table 'Table' cannot be determined. This can happen when a measure formula refers to a column that contains many values without specifying an aggregation such as min, max, count, or sum to get a single result.

aj1973
Community Champion
Community Champion

Did you modify the measure in the picture above to get it work as a Measure? Like in the Return, did you add Sum(Table...)

Try to evaluate your VAR one by one until you get to know which one needs a little modification..... remember to keep the logic of your calculated column.

Regards
Amine Jerbi

If I answered your question, please mark this thread as accepted
and you can follow me on
My Website, LinkedIn and Facebook

What function should I use 'Table'[key] since it is a string?

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.