cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Line Chart - show series only when one item selected

Hi All,

 

I am trying to plot a series of data in a line graph that only shows when I'm focussed on an individual event.

I found this post - Visualisations blank until something selected in a slicer to be very helpful and I feel like I'm 99% there.

 

The trouble I'm having is when I haven't selected an event, the series (Places (M)) plots a count on a few of the dates, I believe this is because there is only one event present on that date.

 

I've tried a few combinations of the formula in the link, also using SELECTEDVALUE. Can anyone help me with correct method of filtering to ensure Places are only given when I explicitly select a single event only?

 

Image_01.png

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
v-jiascu-msft Super Contributor
Super Contributor

Re: Line Chart - show series only when one item selected

Hi @Anonymous,

 

Try this measure, please. You don't need to change the "Cross Filter Direction" this time.

 

Places (M) 2 =
IF (
    ISFILTERED ( Courses[campaignid] ),
    SELECTEDVALUE ( Courses[Maximum Attendees] ),
    BLANK ()
)

 

Best Regards,
Dale

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

View solution in original post

9 REPLIES 9
v-jiascu-msft Super Contributor
Super Contributor

Re: Line Chart - show series only when one item selected

Hi @Anonymous,

 

Can you share a sample, please? Because we need the model structure. How does the event connect with these columns? Is [Places(M)] a measure?

 

 

Best Regards,
Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Re: Line Chart - show series only when one item selected

Hi @v-jiascu-msft,

 

Sorry for slow reply.

I've made a sample. Yes Places (M) is a measure.

 

https://drive.google.com/open?id=1tVQKBv9T7eCx1A5eUDIV4LfTmaDrD7BX

 

Appreciate your help.

Highlighted
v-jiascu-msft Super Contributor
Super Contributor

Re: Line Chart - show series only when one item selected

Hi @Anonymous,

 

Based on your model, you just need to change the "Cross Filter Direction" to Single. It will work. Please refer to the snapshot below. 

Line-Chart-show-series-only-when-one-item-selected

 

 

Best Regards,
Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Re: Line Chart - show series only when one item selected

@v-jiascu-msft

 

Thank you, yup that certainly gets the Places line functioning as I'd hoped, but the time axis is now behaves incorrectly.

It should/was showing from creation date of first associated booking until the last for the selected course. Now it appears to be selecting the first and last for the entire table??

 

v-jiascu-msft Super Contributor
Super Contributor

Re: Line Chart - show series only when one item selected

Hi @Anonymous,

 

Try this measure, please. You don't need to change the "Cross Filter Direction" this time.

 

Places (M) 2 =
IF (
    ISFILTERED ( Courses[campaignid] ),
    SELECTEDVALUE ( Courses[Maximum Attendees] ),
    BLANK ()
)

 

Best Regards,
Dale

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

View solution in original post

Anonymous
Not applicable

Re: Line Chart - show series only when one item selected

@v-jiascu-msft

 

That works in the example but not in my actual model.

I will see if I can figure out why, if only my brain worked as well as yours!

v-jiascu-msft Super Contributor
Super Contributor

Re: Line Chart - show series only when one item selected

Hi @Anonymous,

 

I attached the file in the attachment. You can download it and find if something is wrong.

 

 

Best Regards,
Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Re: Line Chart - show series only when one item selected

@v-jiascu-msft

 

I got it!

 

I wasn't using [campaignid] in my actual model as I'm using a sensitive field not included in the example.

I simply changed the ISFILTERED reference to the appropriate column and it's now working 100% as I'd intended.

 

Thanks very much for your help, it's really great to not only have this as a resource but to receive such prompt replies!

v-jiascu-msft Super Contributor
Super Contributor

Re: Line Chart - show series only when one item selected

It's my pleasure. I'm glad you can benefit from the community.

 

Best Regards,
Dale

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

Helpful resources

Announcements
October 2019 Community Highlights

October 2019 Community Highlights

October was a busy month in the community. Read the recap article to learn about some of the events and content.

New Badges

Incoming: New and Improved Badges

Exciting news: We've given our badges an overhaul and added brand news ones.

Ask Amir Anything

Exclusive LIVE Community Event No. 2 – Ask Amir Anything

Next in our Triple A series: Ask Amir Netz questions about the latest updates, features and future.

Analytics in Azure virtual event

Analytics in Azure virtual event

Experience a limitless analytics service built to ingest, prep, manage, and serve data for immediate use in Power BI.

Users Online
Currently online: 416 members 4,194 guests
Please welcome our newest community members: