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 a visual that shows data relevant to selcted date range (using a Filter on visual level). Is there a possibility of having 2 buttons (1 include and other exclude) when selected, visual show data of the selected date range(if include is selected) and visual shows data of other than the selected date range( if exclude is selected).
For ex. let say i have selected show me data for last month
- selecting include -> want to see the last month data
- selecting exclude -> want to see other than the last month data (data< 1month)
Thanks in advance
Solved! Go to Solution.
Hi @Anandakash ,
It is suggested to create two slicers as follows.
1.Sample data
2.Create a calendar table, and there's no relationship between two tables.
Table 2 = CALENDAR(MIN('Table'[Date]),MAX('Table'[Date]))
3.Create a measure and put it into Filters. Set 'Show items when the values is 1'.
Then the date columns of the two slicers come from different tables.
Measure = IF(ISFILTERED('Table 2'[Date]),IF(NOT(MAX('Table'[Date]) in ALLSELECTED('Table 2'[Date])) ,1),1)
4.Now you can filter.
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anandakash ,
It is suggested to create two slicers as follows.
1.Sample data
2.Create a calendar table, and there's no relationship between two tables.
Table 2 = CALENDAR(MIN('Table'[Date]),MAX('Table'[Date]))
3.Create a measure and put it into Filters. Set 'Show items when the values is 1'.
Then the date columns of the two slicers come from different tables.
Measure = IF(ISFILTERED('Table 2'[Date]),IF(NOT(MAX('Table'[Date]) in ALLSELECTED('Table 2'[Date])) ,1),1)
4.Now you can filter.
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Anandakash , for that you need an independent date table. and one table with two values include and exclude
here date1 is an independent date table, and Date is joined with table
measure =
var _max = maxx(allselected('Date1'), 'Date1'[Date])
var _min = maxx(allselected('Date1'), 'Date1'[Date])
return
if(selectedvalue(incExc[Incude]) = "Include" ,
calculate(sum(Table[Value]), filter('date', 'Date'[Date] >=_min && 'Date'[Date] <=_max )) ,
calculate(sum(Table[Value]), filter('date', 'Date'[Date] <_min && 'Date'[Date] >_max ))
)
Need of an Independent Table in Power BI: https://youtu.be/lOEW-YUrAbE
Need of an Independent Date Table:https://www.youtube.com/watch?v=44fGGmg9fHI
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 |
---|---|
112 | |
100 | |
77 | |
74 | |
49 |
User | Count |
---|---|
146 | |
108 | |
106 | |
90 | |
62 |