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
Anonymous
Not applicable

Line Chart with Two Fixed Values and One Dynamic

Hi all,

 

I'm trying to create a line chart where two of the lines are stationary, but a third changes when a specific month is chosen from a slicer. Here is the .pbix as reference. 

 

In the 'Date Table' table I am using the [Month & Year] as the Legend entry, and [Week No] as the Axis. Finally the [Unique Pageviews] metric from 'Graph Data' is used as the Values. [Month & Year] is then used as the slicer - here is where I get a bit unstuck as I'd like to November 2017 and November 2018 to be 'hardcoded' into the chart and then for the end-user to select another month to be able to see the comparison.

 

Is this possible?

 

TIA,

 

Sam

1 ACCEPTED SOLUTION

@Anonymous attached, also a message is added in case month selection is not valid. You can extend it from here.



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.

View solution in original post

9 REPLIES 9
parry2k
Super User
Super User

@Anonymous fixed months are always going to be Nov 2017 and Nov 2018?



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.

Anonymous
Not applicable

@parry2k No, they will change month-on-month. So for the report I send out in January it would be December 2018 and December 2017 and so on, These months are always the latest and earliest dates in the dataset though.

 

Thanks! 

 

Sam

@Anonymous so to clarify, you want two line charts,

 

one for most recent month available in dataset

one for earliest month available in dataset



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.

Anonymous
Not applicable

@parry2k No, not quite. Requirements are:

 

- Single line chart with three lines on it

- Two of the lines are fixed, earliest and latest month's data

- Third line can be controlled by slicer.

 

If you take a look at the .pbix I've linked to you'll see a rough idea.

 

Thanks!

@Anonymous got it. only challenge i see it, if user doesn't select a month on slicer or select more than one month, it is going to show the sum of those months. How would you like to address this?

 

Although doing min and max month line is not an issue.



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.

Anonymous
Not applicable

Hi @parry2k,

 

These are good questions! Dependent on how things are setup you could specify only single selection on the slicer (if the MIN / MAX dates are elsewhere) - or the other option would be to have some message telling the user that they appear to have selected more than one option (could be based on counting selections, or have a threshold that triggers the message).

 

Sorry, a bit vague!

 

Sam

@Anonymous are you ok to build that logic or you need assistance with that too.



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.

@Anonymous attached, also a message is added in case month selection is not valid. You can extend it from here.



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.

Anonymous
Not applicable

Thank you @parry2k - that was exactly what I was after! Much appreciated Smiley Happy

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.

Top Solution Authors