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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
admin11
Memorable Member
Memorable Member

How to convert yearly bar chart to Accumulated bar chart ?

Hi All

 

I have below yearly expense , in 2019 amount 39 , 2020 amount 19 

i like to plot the chart in accumuate amount .

2019 will display 39 , and 2020 will display 39+19=58

 

admin11_0-1617616112745.png

i think 

AMOUNT_1 = SUM(GL[AMT])
should be change to 
AMOUNT_1 = ACCUMULATE(GL[AMT])
But it cannot work.

 

admin11_0-1617616221336.png

 

1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

Hi, @admin11 

Please correct me if I wrongly understood your question.

Please try the below.

 

accumulate measure = calculate (SUM(GL[AMT]) , filter (allselected (datetable), datetable[datecolumn] <= max(datetable[datecolumn])))

 

Hi, My name is Jihwan Kim.

If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


View solution in original post

4 REPLIES 4
Jihwan_Kim
Super User
Super User

Hi, @admin11 

Please correct me if I wrongly understood your question.

Please try the below.

 

accumulate measure = calculate (SUM(GL[AMT]) , filter (allselected (datetable), datetable[datecolumn] <= max(datetable[datecolumn])))

 

Hi, My name is Jihwan Kim.

If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


@Jihwan_Kim 

Thank you for your help. i get error , because those date field i don't know how to fill in.

@amitchandak 

Thank you very much , your work fine , but not sure why you delete your post ?

amount_int = calculate(SUM(GL[AMT]), filter(allselected(GL), GL[year]<=max(GL[year])))
Above code no error and working fine.
 
Paul
 

Hi,

I was not quite sure about how your date table looks like.

If you do not have date table connected, and your visualization is using Year Column from your main table, then the solution from Amitchandak would be correct.

 

Thank you.

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


@Jihwan_Kim  I did have master calendar table , @amitchandak know my data model very well . He is the one who have answer most of my post. 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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