March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
Register NowGet certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now
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!
Solved! Go to Solution.
Thanks @v-rzhou-msft - 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:
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:
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:
Select Country in Slicer:
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.
Thanks @v-rzhou-msft - 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:
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
Check out the November 2024 Power BI update to learn about new features.
User | Count |
---|---|
116 | |
83 | |
76 | |
62 | |
58 |
User | Count |
---|---|
141 | |
122 | |
105 | |
94 | |
90 |