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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Need a static straight line in 'Stacked and column bar chart' with current YTD sales

Right now,
I have Sales on Y-axis.
I am getting a dynamic line for YTD[Sales] for various months on X-axis. Instead, I want a static line with constant value of current YTD[Sales]. 

For eg. I am getting YTD[Sales] as one of the blue lines here for different months; I am getting previous months' YTD[Sales] which I don't require.

How can I get one straight blue line for YTD[Sales] until current month?


divyesh_143_0-1597734455150.png

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi everyone, I tried all the mentioned methods but nothing worked for me.

My Dax formula was Calculate(DIVIDE(YTD(X), YTD(X) + YTD(Y))), but it was giving not a fixed line.

I created a variable for above DAX formula and returned using 

CALCULATE( calculated_variable ,Datefield  = TODAY())

and it worked!

Thanks everyone for help though.

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi everyone, I tried all the mentioned methods but nothing worked for me.

My Dax formula was Calculate(DIVIDE(YTD(X), YTD(X) + YTD(Y))), but it was giving not a fixed line.

I created a variable for above DAX formula and returned using 

CALCULATE( calculated_variable ,Datefield  = TODAY())

and it worked!

Thanks everyone for help though.
MFelix
Super User
Super User

Hi @Anonymous

 

Not getting the correct question based on the text compared to the image, you want to have a straigth line in your visualization or do you want the line growing until the current month?

 

If you want a straighline you need to add a measure similar to:

 

TotalYTD= CALCULATE(TOTALYTD(SUM('Table'[Values]), 'Table'[Date]), ALLSELECTED('Table'[Date])
)

Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



parry2k
Super User
Super User

@Anonymous what measure you used for YTD Sales can you share the DAX expression?

 

 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors
Top Kudoed Authors