Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi,
I wish to filter below graph on different logic,
1) If i select month from any fiscal year the graph should filter for that Fiscal year. like below image. in below image i have selected fiscal year
2) If there is no option selected then it should filter for currunt fiscal year. my graph is like below image
Solved! Go to Solution.
Hi @Amardeep100115 ,
I have built a data sample for test.
According to my understanding,
1.If no year selected , show the current year, 2 years before.
2.If year selected, show the selected value
If so , you need create a new table with Year for slicer:
Then use the following formula to create a measure:
Measure =
VAR _sele =
CALCULATE (
SUM ( 'Table'[Value] ),
FILTER ( 'Table', 'Table'[Year] IN ALLSELECTED ( 'ForSlicer'[Year] ) )
)
VAR _nosele =
CALCULATE (
SUM ( 'Table'[Value] ),
FILTER (
'Table',
'Table'[Year] - YEAR ( TODAY () ) >= -2
&& 'Table'[Year] - YEAR ( TODAY () ) <= 0
)
)
RETURN
IF ( ISFILTERED ( 'ForSlicer'[Year] ), _sele, _nosele )
The final output is shown below:
If it does not make sense, please share me with your pbix file after removing sensitive data.
Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Amardeep100115 ,
I have built a data sample for test.
According to my understanding,
1.If no year selected , show the current year, 2 years before.
2.If year selected, show the selected value
If so , you need create a new table with Year for slicer:
Then use the following formula to create a measure:
Measure =
VAR _sele =
CALCULATE (
SUM ( 'Table'[Value] ),
FILTER ( 'Table', 'Table'[Year] IN ALLSELECTED ( 'ForSlicer'[Year] ) )
)
VAR _nosele =
CALCULATE (
SUM ( 'Table'[Value] ),
FILTER (
'Table',
'Table'[Year] - YEAR ( TODAY () ) >= -2
&& 'Table'[Year] - YEAR ( TODAY () ) <= 0
)
)
RETURN
IF ( ISFILTERED ( 'ForSlicer'[Year] ), _sele, _nosele )
The final output is shown below:
If it does not make sense, please share me with your pbix file after removing sensitive data.
Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Amardeep100115 maybe change your measure as below that shows the value for the line
Sales Default =
VAR __selectedYear = CALCULATE ( MAX ( 'Calendar'[Year] ), ALLSELECTED ( 'Calendar'[Year] ) )
RETURN
CALCULATE ( SUM ( Table[Sales] ), KEEPFILTERS ( TREATAS ( { __selectedYear }, 'Calendar'[Year] ) ) )
Check my latest blog post Comparing Selected Client With Other Top N Clients | PeryTUS I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!
⚡Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.⚡
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
110 | |
94 | |
82 | |
66 | |
58 |
User | Count |
---|---|
151 | |
121 | |
104 | |
87 | |
67 |