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 have a slicer where user can select one month from a dropdown list as start month.
I would need to add the selected month number as a fixed value as a calculated column.
this is my Start_month table, and in the "Selected" calculated column I would like to see 3 for each row
how could I create that column?
Solved! Go to Solution.
Hi @bsz412 ,
I just created a table with Date column to test.
And we need to create three tables for three slicers with all Year/ all Months:
Then please create a flag measure, and apply it to visual-filter pane, set as "is 1"
Filter Flag =
var _minDate=DATE(MIN('Year slicer'[Year]),MAX('Start Month'[Value]),1)
var _maxDate=DATE(MAX('Year slicer'[Year]),MAX('End Month'[Value])+1,1)
RETURN IF(MAX('Table'[Date]) >=_minDate && MAX('Table'[Date])<_maxDate,1,0)
The original table will be filtered between 2020/7/1- 2021/2/28:
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 @bsz412 ,
I just created a table with Date column to test.
And we need to create three tables for three slicers with all Year/ all Months:
Then please create a flag measure, and apply it to visual-filter pane, set as "is 1"
Filter Flag =
var _minDate=DATE(MIN('Year slicer'[Year]),MAX('Start Month'[Value]),1)
var _maxDate=DATE(MAX('Year slicer'[Year]),MAX('End Month'[Value])+1,1)
RETURN IF(MAX('Table'[Date]) >=_minDate && MAX('Table'[Date])<_maxDate,1,0)
The original table will be filtered between 2020/7/1- 2021/2/28:
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 @bsz412 ,
My initial thought was that this shouldn't be possible because the values in the calculated column are updated during a data refresh. This means any time your selection in the report would change, the value in the calculated column will not update.
Here they discussed this issue:
Solved: Using Slicer values in a calculated column - Microsoft Power BI Community
And here another suggestion for a solution:
Power BI calculated column based on Slicer - deBUG.to
Does this help? 🙂
/Tom
https://www.tackytech.blog/
https://www.instagram.com/tackytechtom/
Did I answer your question❓➡️ Please, mark my post as a solution ✔️ |
Also happily accepting Kudos 🙂 |
Feel free to connect with me on LinkedIn! |
#proudtobeasuperuser |
Hi @tackytechtom,
Thanks for the clarification. The reason why I was trying this, is because I have to build a period slicer that looks like this
They insist so hard, so building something else instead is unfortunately not an option. I was hoping that capturing the start year&month combo and end year&month in a measure can somehow help me filter the calendar table to the values that fall in between those 2 values.
Right now I have no idea how will I create this format 😞
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 |
---|---|
96 | |
93 | |
82 | |
70 | |
64 |
User | Count |
---|---|
118 | |
106 | |
93 | |
79 | |
72 |