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.
Greetings!
I have an entire dashboard set up with simple tables like this:
Company | 2019 Units | 2020 Units | Var |
Apple | 100 | 200 | 100 |
Bose | 200 | 300 | 100 |
Chiquita | 300 | 400 | 100 |
Controlled by a radio slicer of Sales Rep and a checkbox slicer of months, and feeding from a datatable like this:
Company | Product | Units | Order Date | Sales Rep |
Bose | Apricot | 20 | 5/1/2019 | Adam |
Apple | Banana | 40 | 5/1/2019 | Bella |
Chiquita | Cantaloupe | 52 | 5/1/2019 | Cornelius |
Bose | Cantaloupe | 30 | 5/1/2019 | Bella |
Apple | Apricot | 11 | 6/1/2019 | Cornelius |
Chiquita | Banana | 66 | 6/1/2019 | Adam |
I have been tasked with creating a radio slicer to add to this that would offer three options: Month, Rolling 3 Month, Rolling 6 month. The existing slicers are already filtering by month and Sales Rep.
Currently, if I had January and February selected, the value in the report would represent January units plus February units. The Month radio button would allow this data to pass through unmodified.
The Rolling 3 month radio button should change that output into an average of last November units, last December units, and last January units PLUS an average of last December units, January units, and February units.
Likewise, if the Rolling 6 month radio button was selected, it would change a January and February selection on the checkbox slicer of months to: An average of last August, last September, last October, last November, last December, and January units PLUS an average of last September, last October, last November, last December, January, and February units.
How would I create such a radio slicer that would interact in the desired way with a month checkbox slicer in which one, two, or twelve months can be selected?
You can create rolling measure using date calendar like this
Rolling 3 = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date],ENDOFMONTH(Sales[Sales Date]),-3,MONTH))
Rolling 3 = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date Filer],MAX(Sales[Sales Date]),-3,MONTH))
Rolling 6 = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date],ENDOFMONTH(Sales[Sales Date]),-6,MONTH))
Rolling 6 = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date Filer],MAX(Sales[Sales Date]),-6,MONTH))
Refer to this how to shift/toggle measures
Create a disconnected table for your slicer. Then use a measure like this:
Measure to Show =
VAR __Selected = SELECTEDVALUE('SlicerTable'[Column])
RETURN
SWITCH(__Selected,
"3 Month",[3 Month Measure],
"12 Months",[12 Month Measure],
<etc.>
)
All of my slicers are already set up as tables, but all are attached to something. By keeping this one isolated, it isn't making any alterations at all, let alone playing well with the other two slicers. Perhaps I need to provide more detail.
My data table has a many-to-one cross-directional relationship with my calendar table and my Sales Rep table (just a list of names). There are dozens of other moving parts that aren't relevant to my current question such that I can't just start unlinking tables willy-nilly. The month slicer feeds directly off the calendar table, and the Sales Rep slicer feeds directly off the Sales Rep table. The measures I'm using on the data table are as follows:
For your case, you could refer to this blog:
Dynamically change the information within a visual via a slicer
Regards,
Lin
While this touches on the category of what I need, it doesn't really get into how to dynamically change measures on a page or how to effectively overlap these filters without issue.
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 |
---|---|
110 | |
95 | |
76 | |
65 | |
51 |
User | Count |
---|---|
146 | |
109 | |
106 | |
88 | |
61 |