Get 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
Dear all,
I have a table as following:
ID | Start date | End date |
A | 15-2-2018 | 15-6-2025 |
B | 1-1-2020 | 1-1-2024 |
C | 26-2-2021 | 31-12-2021 |
I would like to have a slicer on my report with a year and then show the selected IDs where the year is in (and in between) the start and end date. Example with results:
I filter 2019, this would only give me ID 'A' because that is the only ID where A is active.
I filter 2021, I returns all three, cause all three are taking place in this year.
Solved! Go to Solution.
@Anonymous solution attached, you can tweak as per your need.
Check my latest blog post Compare Budgeted Scenarios vs. Actuals 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.
@Anonymous here is the updated measure and in visual level filter change where a value greater than equal to 1
In the future, do create a separate post and do refer back to the original post, doesn't matter if it is an extension of existing question:
Filter Id =
VAR __result =
SUMX (
VALUES ( 'Table'[ID] ),
VAR __selectedYear = SELECTEDVALUE ( Years[Year], YEAR ( TODAY() ) )
VAR __minBuildDate = YEAR ( CALCULATE ( MIN ( 'Table'[Start date] ) ) )
VAR __maxBuildDate = YEAR ( CALCULATE ( MIN ( 'Table'[End date] ) ) )
RETURN
IF ( __selectedYear >= __minBuildDate && __selectedYear <= __maxBuildDate, 1, 0 )
)
RETURN __result
Check my latest blog post Compare Budgeted Scenarios vs. Actuals 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.
@Anonymous not fully sure what you are looking for, maybe open another post and refer back to this so that these stay as a separate solution.
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.
@parry2k well it is actually the same dataset and case. with the following results in a cardvisual
I filter 2019, this would only give me ID 'A' because that is the only ID where A is active. so the count would be 1 (the result).
I filter 2021, I returns all three, cause all three are taking place in this year. which gives me 3 as a result.
2024 returns 2 and so on.
@Anonymous solution attached, you can tweak as per your need.
Check my latest blog post Compare Budgeted Scenarios vs. Actuals 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.
@parry2k can you also make this work when you want to distinctcount the IDs in a card visual? you cant use the measure as a filter like in a table then.
Check out the October 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
115 | |
112 | |
105 | |
95 | |
58 |
User | Count |
---|---|
174 | |
147 | |
136 | |
102 | |
82 |