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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
miii
Frequent Visitor

Show line instead of dot in line chart when months is selected

Hi - I have a month slicer and a line graph.  When I select Feb, the line graph changes from line to a dot and displays Feb YTD.  I want the line to display Jan YTD and Feb YTD with a line instead of the dot for the selected month.  If no month is selected, I want the line to show all YTD month values upto available month.

 

Here are my tables:

 

Calendar Table

 

Actuals Table

Date joins to calendar table

Actuals YTD Measure

 

2019-02-22_11-30-51.png2019-02-22_11-30-30.png

 

1 ACCEPTED SOLUTION
v-frfei-msft
Community Support
Community Support

Hi @miii ,

 

1. Create a date table.

 

date = CALENDARAUTO()

2. Create a measure as below.

 

Measure = 
VAR _date =
    MAX ( 'date'[Date] )
RETURN
    CALCULATE ( SUM ( Table1[values] ), FILTER ( Table1, 'Table1'[date] <= _date ) )

Capture.PNG

 

Please find the pbix as attached.

 

Regards,

Frank

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

View solution in original post

5 REPLIES 5
Ashish_Mathur
Super User
Super User

Hi,

 

See if my article here helps - Flex a Pivot Table to show data for x months ended a certain user defined month.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
v-frfei-msft
Community Support
Community Support

Hi @miii ,

 

1. Create a date table.

 

date = CALENDARAUTO()

2. Create a measure as below.

 

Measure = 
VAR _date =
    MAX ( 'date'[Date] )
RETURN
    CALCULATE ( SUM ( Table1[values] ), FILTER ( Table1, 'Table1'[date] <= _date ) )

Capture.PNG

 

Please find the pbix as attached.

 

Regards,

Frank

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

Thank you  helped. I already had a Calender table just didn't know how to write the syntax will all the variables.

 

This is what I used and it worked.

Actual YTD:=
var maxyear = MAX('Calendar'[Relative Year Index])
var _month = MAX(Scenario[SCENARIO_NUM])
return
               CALCULATE(
                              [Actual],
                              filter(
                                             'Calendar',
                                             and(
                                                            'Calendar'[Relative Year Index] = maxyear ,            
                                                            'Calendar'[Month] <= _month
                                             )
                              )
               ),                            
               DATESYTD('Calendar'[Date])
)
Monthly Actual Line:= 

var _month = MAX('Scenario'[SCENARIO_NUM])
RETURN

if(
	VALUES('Calendar'[Month]) <= _month,
	CALCULATE(
		[Monthly Actual],
		filter('Actuals','Actuals'[ACCOUNTING_DT]),
		DATESYTD('Calendar'[Date])
	),
	Blank()
)
Greg_Deckler
Super User
Super User

Search for my Time Intelligence the Hard Way quick measure


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

I have tried going through the topic and formula but it didn't help my situation. 

 

Any other clues would be greatly appreciated.

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

AugPowerBI_Carousel

Power BI Monthly Update - August 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

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