Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
I have data from Jan 2022 to september 2024
I have 2 graphs
If I select on 2023 slicer
One graph is with sum(sales) from Jan 2023 to Dec 2023 to be displayed ( it is working)
However, my requirement is to display in another graph from May 2023 to May 2024 which is not working
I have tried but it is showing from May 2023 to Dec 2023
Could someone help me with this ?
Solved! Go to Solution.
Thanks for the reply from FlipFlop1 , please allow me to provide another insight:
Hi @Emerald70 ,
I created some data:
As far as I know, when the slicer makes a selection, the visual that is related to the slicer field also changes dynamically, you might consider creating a table with no join relationship and using measure to affect the two visuals separately.
Here are the steps you can follow:
1. Create calculated table.
Table 2 =
DISTINCT('Table'[Year])
2. Create measure.
Visual_May2023toMay 2024 =
var _select=SELECTEDVALUE('Table 2'[Year])
var _mindate=DATE(_select,5,1)
var _maxdate=EOMONTH(DATE(_select+1,5,1),-1)
return
IF(
MAX('Table'[Date])>=_mindate&&MAX('Table'[Date])<=_maxdate,1,0)
Visual_allyear =
var _select=SELECTEDVALUE('Table 2'[Year])
return
IF(
MAX('Table'[Year])=_select,1,0)
3. Place each of the two measures in the corresponding visual filter and set it to 1.
4. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Thanks for the reply from FlipFlop1 , please allow me to provide another insight:
Hi @Emerald70 ,
I created some data:
As far as I know, when the slicer makes a selection, the visual that is related to the slicer field also changes dynamically, you might consider creating a table with no join relationship and using measure to affect the two visuals separately.
Here are the steps you can follow:
1. Create calculated table.
Table 2 =
DISTINCT('Table'[Year])
2. Create measure.
Visual_May2023toMay 2024 =
var _select=SELECTEDVALUE('Table 2'[Year])
var _mindate=DATE(_select,5,1)
var _maxdate=EOMONTH(DATE(_select+1,5,1),-1)
return
IF(
MAX('Table'[Date])>=_mindate&&MAX('Table'[Date])<=_maxdate,1,0)
Visual_allyear =
var _select=SELECTEDVALUE('Table 2'[Year])
return
IF(
MAX('Table'[Year])=_select,1,0)
3. Place each of the two measures in the corresponding visual filter and set it to 1.
4. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
But I have to get the result based on selection right , I should select bcz my DAX is like below
I would suggest just using current year and last year sales on the same graph:
DAX for last year as follows:
It sounds like the 2023 slicer is slicing your 2nd graph. I you click on the slicer and select Format > Edit Interactions, you can prevent the slicer from acting on your graph (click the no-entry sign at the top right of the graph).
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
69 | |
68 | |
40 | |
29 | |
26 |
User | Count |
---|---|
88 | |
49 | |
45 | |
38 | |
37 |