Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Hi
I have created a line chart where it can compare the trends for 2 years.
For this line chart, I want it to remain trending for 2 years without changing either if I choose any reporting year.
How can I do this?
For Axis fields I selected = Reported Date
For Legend fields I selected - Reported Date and change it by date hierarchy
For the Value fields I created a measure =
Solved! Go to Solution.
Hi Zaky, you can disable the effect of the year slicer on that visual.
You can then either filter your visual manually to the years you want using the filter pane, or do this dynamically.
Assuming you have a column for year in your table which you're using for your legend, you could use something like this to filter your measure to current + previous year.
Measure = //create variable to store current year Var CurrentYear = year(now()) RETURN if(max('Master'[Year]) in{CurrentYear,CurrentYear-1},CALCULATE(COUNT('Master'[Incident ID]))) |
Hi Zaky, you can disable the effect of the year slicer on that visual.
You can then either filter your visual manually to the years you want using the filter pane, or do this dynamically.
Assuming you have a column for year in your table which you're using for your legend, you could use something like this to filter your measure to current + previous year.
Measure = //create variable to store current year Var CurrentYear = year(now()) RETURN if(max('Master'[Year]) in{CurrentYear,CurrentYear-1},CALCULATE(COUNT('Master'[Incident ID]))) |
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
76 | |
76 | |
56 | |
38 | |
34 |
User | Count |
---|---|
99 | |
56 | |
51 | |
44 | |
40 |