Forum Discussion
Combining matrix
- Anonymous1 year ago
Hi Marico ,
According to your description, you want to display the data of the current month and the previous five months, and users can use slicer to change the columns in the matrix. Currently, the built-in slicer does not support the default option. I recommend that you use the preselected slicer. The following is my test for your reference. Since I don't know how your year-end target column is obtained, I only display the data up to the current month.
Step1. Add preselected slicer.
Step2. Custom table and Measure.
_PreselectedSlicer = DATATABLE( "IsDirtySlicer", BOOLEAN, { {FALSE()}, {TRUE()} } )Measure 2 = VAR _select_date = SELECTEDVALUE('Date'[Month-Year]) VAR _previous =UNION(SELECTCOLUMNS(GENERATESERIES(0,5,1),"test",FORMAT(EDATE(TODAY(),-[Value]),"YYYY-MMM")),ROW("test","CurrentYear")) RETURN IF(_select_date IN _previous,TRUE(),FALSE())Step3. The Matrix.
Buttons of preselected slicer.
Best regards,
Mengmeng Li
Hi Marico ,
I'm afraid Power BI Desktop doesn't have a slicer like that. The selections in most slicers are manual, or have defaults set at the beginning like the preselected slicer.
I'm using TODAY() to generate a single list that includes the first five months of the current month, so it's dynamic. When it comes to the next month, the preselected slicer will select February and the first five months by default, and the user doesn't need to select them manually.
I can't give any more advice on the target column because I don't know what the logic of its calculation is. Please provide some examples. Since I will have the weekend off and my next reply will perhaps be next Monday, I suggest you try the method I provided first. Include in the next reply any related problems encountered and I will get back to you as soon as I see it.
Best regards,
Mengmeng Li
Hi Anonymous
"I'm using TODAY() to generate a single list that includes the first five months of the current month, so it's dynamic. When it comes to the next month, the preselected slicer will select February and the first five months by default, and the user doesn't need to select them manually."
For the blue highlighted part, when the februrary will come then the slicer and table will have the following months appearing in the table and slicer -> 2024-Sep, 2024-Oct, 2024-Nov, 2024-Dec, 2025-Jan, Current Month - Is this correct understanding? If so, then this is as per the requirement.
Regarding the target data, there are no calculations in this, in the target table for each end of the month, there is a target % [fully % op] associated with it. Please have a look at the target table in the shared file and the description of this post on how the target needs to be merged with the above requirement.
Please let me know if I need to share more details about the requirements. Thanks.
- Anonymous1 year agoNot applicable
Hi Marico ,
I would recommend that you do not display the target column in the Matrix, the easiest way to do this is to display it separately using Card. Because the display of the columns in the Matrix is determined by the preselector slicer, which takes its options from the Month-Year of the date column, this means that if you want to display the Target column in the matrix, you have to add the corresponding row in Month-Year, but the calculation logic of Target is different from that of the other dates, and its relation to the Sales table is difficult to define. All things considered, using cards to display Target values is the simplest and most stable method.
Best regards,
Mengmeng Li
- Marico1 year agoHelper IV
Anonymous Thanks for your response.
Let me check with the client on creating cards for the target values.
Could you confirm the following as well, please?
"I'm using TODAY() to generate a single list that includes the first five months of the current month, so it's dynamic. When it comes to the next month, the preselected slicer will select February and the first five months by default, and the user doesn't need to select them manually."
For the blue highlighted part, when the februrary will come then the slicer and table will have the following months appearing in the table and slicer -> 2024-Sep, 2024-Oct, 2024-Nov, 2024-Dec, 2025-Jan, Current Month - Is this correct understanding? If so, then this is as per the requirement.
- Anonymous1 year agoNot applicable