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.
If I select 2017 then 2017-2019 should be selected and if i select 2018 than 2018 and 2019 to be selected and if 2019 only 2019 to be selected?
Solved! Go to Solution.
Hi @Anonymous ,
We can create a date table that is no relationship and a measure to meet your requirement.
1. Create a date table.
Date = ADDCOLUMNS(CALENDAR("2017/1/1","2019/12/31"),"year",YEAR([Date]))
2. Then we can create a measure,
measure =
VAR _Select =
SELECTEDVALUE ( 'Date'[year] )
RETURN
IF (
ISBLANK ( _Select ),
CALCULATE ( SUM ( 'Table'[value] ) ),
CALCULATE (
SUM ( 'Table'[value] ),
FILTER ( 'Table', 'Table'[year] >= _Select && 'Table'[year] <= _Select + 2 )
)
)
If it doesn’t meet your requirement, could you please show the exact expected result based on the table that we have shared?
BTW, pbix as attached.
Best regards,
Community Support Team _ zhenbw
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
How about the result after you follow the suggestions mentioned in my original post?
Could you please provide more details or expected result about it If it doesn't meet your requirement?
If you've fixed the issue on your own please kindly share your solution.
Best regards,
Community Support Team _ zhenbw
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
We can create a date table that is no relationship and a measure to meet your requirement.
1. Create a date table.
Date = ADDCOLUMNS(CALENDAR("2017/1/1","2019/12/31"),"year",YEAR([Date]))
2. Then we can create a measure,
measure =
VAR _Select =
SELECTEDVALUE ( 'Date'[year] )
RETURN
IF (
ISBLANK ( _Select ),
CALCULATE ( SUM ( 'Table'[value] ) ),
CALCULATE (
SUM ( 'Table'[value] ),
FILTER ( 'Table', 'Table'[year] >= _Select && 'Table'[year] <= _Select + 2 )
)
)
If it doesn’t meet your requirement, could you please show the exact expected result based on the table that we have shared?
BTW, pbix as attached.
Best regards,
Community Support Team _ zhenbw
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Anonymous , You can not change slicer you can change the value in a measure
measure =
var _max = maxx(allselected(Date),Date[Year])
return
calculate(sum(Table[column]), filter(all(Date), Date[Year]>=_max && Date[Year]<=_max+2))
@Anonymous Yes it can be achieved but you have to have a separate table for a slicer with uniques values for a year, let's assume this slicer table is called Slice Year with column Year, add the following measure and then use this measure for visual level filter
Filter Year =
VAR __selectedYear = SELECTEDVALUE ( 'Slicer Year'[Year] )
RETURN
MAX ( YourTable[Year] ) - __selecteYear
In a visual level filter of the matrix put Filter Year measure and filter with greater than equal to zero and it would work.
I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos 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 sure wht you are trying to do, you want see the range of year based on selection or you want sum amount for ranges of year.
provide bit more context of your question. Read this post to get your answer quickly.
https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
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.
sure, I have matrix below in columns I have the years and in rows I have products
if from slicer i select 2017 the years from 2017 to 2019 should come in matrix
if from slicer i select 2018 the years from 2018 to 2019 should come in matrix
if from slicer i select 2019 than year 2019 should come in matrix
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 |
---|---|
113 | |
99 | |
80 | |
70 | |
59 |
User | Count |
---|---|
149 | |
114 | |
107 | |
89 | |
67 |