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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
Anonymous
Not applicable

Accumulative Value in Line Chart

Hello there,

 

First of all, excuse me and my low skills on DAX.

I have this "Earnings" column, and I need a Line chart where it shows an Accumulative version during time with the legend of the shop_id.

This table is on DirectQuery mode, but I think this Accumulative measure can be done in the Desktop page.

 

FYI: The chart will be showing real-time data and only for the current day (I don't know if this info is helpful and important for the measure, sorry).

SHOP_IDEARNINGSTIME
1$45.6016:50
2$980,654.8811:20
3$324.0113:30
4$109:10
5$54.7822:20

 

Any help or advice would be kindly appreciated.

 

Thank you!

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , Ideal is datetime column and cumulative like

 

sumx(filter(allselected(Table), Table[Datetime] <= Max(Table[Datetime])), Table[Earning])

 

or

sumx(filter(allselected(Table), Table[Datetime] <= Max(Table[Datetime]) && Table[ID] = max(Table[ID]) ) , Table[Earning])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@Anonymous , Ideal is datetime column and cumulative like

 

sumx(filter(allselected(Table), Table[Datetime] <= Max(Table[Datetime])), Table[Earning])

 

or

sumx(filter(allselected(Table), Table[Datetime] <= Max(Table[Datetime]) && Table[ID] = max(Table[ID]) ) , Table[Earning])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

AllToKnow00_0-1647879126365.png

When using the second design, the one with IDs, I get the chart above. And when I use the first one, I get the chart below with the value accumulating in all the shops at the same time.

AllToKnow00_1-1647879478099.png

 

I think I must add that each shop_id will appear more than once in the table, because you can buy something in one shop several times on several days.

 

What I'm trying to draw is one continuous accumulative line for each shop during that time period.

 

Sorry for all this bothering, and thank you for your time and patience!

 

 

Anonymous
Not applicable

Hi @Anonymous ,  

 

I agree with amitchandak 's second code. I have a test by amitchandak 's code, and it will work in my sample. 

1.png

Could you share more details about your data model or share a sample file created by import mode with us? This will make it easier for us to find the solution.

 

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.