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.
I have to create a report from a table.
i need to add a date slicer which should be like this.
i can't consider any date column from my table for creating slicer.The thing is if i click on jan 2022
report data should be filter out data based on these condition...and also i can't add 2021 slicer date here,can add only upto march date now .
Solved! Go to Solution.
Hi, @NISHA_S
Create the following calculated column, then create the slicer
Column =
SWITCH(
TRUE(),
[policy_effective_date]<dt"2022-1-1"&&[policy_expiration_date]>=dt"2020-12-31",FORMAT(dt"2022-1-1","dd-MMMM-yyyy"),
[policy_effective_date]<dt"2022-2-1"&&[policy_expiration_date]>=dt"2021-1-31",FORMAT(dt"2022-2-1","dd-MMMM-yyyy"),
[policy_effective_date]<dt"2022-3-1"&&[policy_expiration_date]>=dt"2021-1-31",FORMAT(dt"2022-3-1","dd-MMMM-yyyy")
)
Result:
If you don't want to create a column in the original table, you can create a filter measure and filter items with a measure equal to 1 in the filter pane.
Please refer to the attachment below for details.
Hope this helps.
Best Regards,
Community Support Team _ Zeon Zheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @NISHA_S
Create the following calculated column, then create the slicer
Column =
SWITCH(
TRUE(),
[policy_effective_date]<dt"2022-1-1"&&[policy_expiration_date]>=dt"2020-12-31",FORMAT(dt"2022-1-1","dd-MMMM-yyyy"),
[policy_effective_date]<dt"2022-2-1"&&[policy_expiration_date]>=dt"2021-1-31",FORMAT(dt"2022-2-1","dd-MMMM-yyyy"),
[policy_effective_date]<dt"2022-3-1"&&[policy_expiration_date]>=dt"2021-1-31",FORMAT(dt"2022-3-1","dd-MMMM-yyyy")
)
Result:
If you don't want to create a column in the original table, you can create a filter measure and filter items with a measure equal to 1 in the filter pane.
Please refer to the attachment below for details.
Hope this helps.
Best Regards,
Community Support Team _ Zeon Zheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@NISHA_S , You should use a date table with month year, preferably independent date table
if you select Jan 2022
// policy_effective_date < '1/1/2022' AND policy_expiration_date >= '12/31/2020'
measure =
var _max = minx(filter(allselected('Date'), 'Date'[Date])
var _min = eomonth(_max, -13)
return
calculate(sum(Table[Value]), filter(Table, Table[ policy_effective_date] < _max && Table[policy_expiration_date] >= _min ) )
can u please tell about what is this Table[Value] means? am not using any value named column here
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 |
---|---|
97 | |
97 | |
81 | |
77 | |
66 |
User | Count |
---|---|
126 | |
105 | |
103 | |
81 | |
72 |