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
Anonymous Anonymous I have created the following measure (or separate measure for current month and previous month) to calculate the month-over-month percentage change. How can I calculate this percentage change based on the slicer selection?
Sales MoM% =
VAR __PREV_MONTH = CALCULATE(
SUM(Sales[Sales Amount]),
PREVIOUSMONTH(Sales[Date]),ALL(Date[Month-Year])
)
RETURN
DIVIDE(
SUM(sales[sales amount]) - __PREV_MONTH,
__PREV_MONTH
)