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

Get Fabric Certified for FREE during AI Skills Fest. This week only. Secure your voucher now.

Reply
Anonymous
Not applicable

Blank line graph with time series data and only show data with slicer selection

Hello helpful community,

 

Given the speed at which Power BI updates are made, most of the previous posts on this are no longer helpful as they reference interfaces that do not exist at this time (such as parts of this https://www.mssqltips.com/sqlservertip/6850/power-bi-slicer-dynamic-visuals/)

 

Here is my situation: I have time-series data and want to show index-scores across time by country.

 

Therefore, X-axis=year, Y-axis=indexscore, Legend=country name. My slicer has "country". I would like a blank graph to show until I select a country. Unfortunately, after having tried numerous different types of filters including INT(ISFILTERED(Table[country])) then putting this measure into the visual's filter and doing the whole 'show items when the value is =1, apply filter... I cannot get any DAX to work.

 

Any insight onto how to get this to work? Do I need to include an "isfiltered" condition on "year" as well? I would prefer not to. I'd like to only have the user select a country in the slicer, and see the country's change in score over time.

 

Thank you!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Thanks @Anonymous - for some reason, I could not get your solution to work. However, I connected with a colleague and here was the solution that worked for me in the end:

1. Create the measure for a "blank" line graph:

CountrySelected =
VAR CountrySliced =
CALCULATE(
    ISFILTERED('Table1'[Country]),
    ALLSELECTED('Table1'[Country])
)
RETURN
if(
    CountrySliced,
    SUM('Table'[China_Exposure_2]),
    BLANK()
)
 
2. Create a blank card (transparency set to zero) that instructs the reader to select a country in order to see data populated:
 
cardtext =
if( [CountrySelected],
    "",
    "Please select a country to populate this graph"
    )

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @Anonymous ,

 

I think this should be caused by you add [Country] into Legend Field. Here I suggest you to create an unrelated DimCountry table in your report.

DimCountry = 
VALUES(Sheet1[Country])

Relationship:

RicoZhou_0-1666859619352.png

Then try this measure.

Measure = 
VAR _SELECTION = VALUES(DimCountry[Country])
RETURN
IF(ISFILTERED(DimCountry[Country]),CALCULATE(SUM(Sheet1[Value]),FILTER(Sheet1,Sheet1[Country] in _SELECTION)),BLANK())

Result is as below.

By Default:

RicoZhou_1-1666859638551.png

Select Country in Slicer:

RicoZhou_2-1666859705514.png

 

 

Best Regards,
Rico Zhou

 

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

Anonymous
Not applicable

Thanks @Anonymous - for some reason, I could not get your solution to work. However, I connected with a colleague and here was the solution that worked for me in the end:

1. Create the measure for a "blank" line graph:

CountrySelected =
VAR CountrySliced =
CALCULATE(
    ISFILTERED('Table1'[Country]),
    ALLSELECTED('Table1'[Country])
)
RETURN
if(
    CountrySliced,
    SUM('Table'[China_Exposure_2]),
    BLANK()
)
 
2. Create a blank card (transparency set to zero) that instructs the reader to select a country in order to see data populated:
 
cardtext =
if( [CountrySelected],
    "",
    "Please select a country to populate this graph"
    )

Helpful resources

Announcements
May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.