Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowGet inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.
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).
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code FABINSIDER for a $400 discount!
Check out the February 2025 Power BI update to learn about new features.
User | Count |
---|---|
84 | |
69 | |
66 | |
51 | |
32 |
User | Count |
---|---|
116 | |
99 | |
75 | |
65 | |
40 |