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
Todward
Frequent Visitor

Line Chart with YTD average figures

Dear all

 

I would like to create a line chart similar to the one in the screenshot below. However the figures in this chart should not be the monthly figures but the YTD average of this specific month. Means January with only January data, February with total costs of Jan and Feb divided by total volume of Jan and Feb and so on. I also added a screenshot of an excel table to demonstrate what I'm looking for.

 

Does someone has an idea how to realize this?

Thank you for your help.

 

 

chart 1.pngTable 1.png

 

1 ACCEPTED SOLUTION
TomMartens
Super User
Super User

Hey @Todward ,

I guess you have a dedicated calendar table, which is related to your fact table. I also recommend reading this article: https://www.daxpatterns.com/time-patterns/

I create two measures for its volume and COGS as well:

YTD quantity = TOTALYTD(CALCULATE(SUM('Fact Sale'[Quantity])) , 'Dimension Date'[Date])

Create a third measure that divides the previous measures accordingly.

Hopefully, this provides what you're looking for.

Best regards

cat



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

View solution in original post

4 REPLIES 4
lbeneyze
Advocate II
Advocate II

Good morning,

I'm assuming that you are using a date dimension and have marked it as date table

I think you have to create some calculated measures to realise that:

  - YTD Volume (use Quick Measures)

  - YTD Average COGS (use Quick Measures)

  - YTD average COGS/Volume = Divide(YTD Average COGS, YTD Volume)

Use the last measure in your chart.

 

if you like my answer, please add a 👍

if my answer answers your question, please mark it as a solution.

Thanks in advance and good luck.

 

Thank you @lbeneyze much appreciated

 

TomMartens
Super User
Super User

Hey @Todward ,

I guess you have a dedicated calendar table, which is related to your fact table. I also recommend reading this article: https://www.daxpatterns.com/time-patterns/

I create two measures for its volume and COGS as well:

YTD quantity = TOTALYTD(CALCULATE(SUM('Fact Sale'[Quantity])) , 'Dimension Date'[Date])

Create a third measure that divides the previous measures accordingly.

Hopefully, this provides what you're looking for.

Best regards

cat



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

thank you @TomMartens 

worked very well!

Viele Grüsse aus Süddeutschland

Todward

 

 

 

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.