Forum Discussion

jismongeorge63's avatar
jismongeorge63
New Member
2 years ago
Solved

Dynamically Changes affect the Matrix columns

Can anyone please help me achieve this? 1) List the Customers and their corresponding Sales in a Matrix for a period of 4 months a. These Customers SHOULD have sales for the CURRENT MONTH and at ...
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi,jismongeorge63 .Hello,amitchandak ,

    thanks for your concern about this issue.

    Your answer is excellent!
    And I would like to share some additional solutions below.
    I am glad to help you.

    According to your description, you want to select a month through the slicer, and display the data of the previous three months in visual without that month.

    If I understand you correctly, you can refer to the following test I did below

    This is my test data

    I constructed a date table, Dates, to use as a slicer (which has nothing to do with the table:"case03")

    I have created a measure, which marks out the dates that are in the first three months of the month selected by the slicer (excluding the month selected by the slicer), and marks it as 1 if it is satisfied, and 0 otherwise.

     

    M_result = 
    VAR dateValues=MAX('Dates'[Date_])
    VAR previousThreeMonthStart=EOMONTH(dateValues,-4)+1
    VAR previousThreeMonthEnd=EOMONTH(dateValues,-1)
    
    RETURN 
    IF(MAX('case03'[Date])>=previousThreeMonthStart&&MAX('case03'[Date])<=previousThreeMonthEnd,1,0)
    

     



    Modify the filter criteria in the Filters field: when filtering by M_result, only data with M_result of 1 will be filtered.

    like this.

    If you want to include the selected month, you can use the following measure: M_includeSelected

     

    M_includeSelected = 
    
    VAR dateValues=MAX('Dates'[Date_])
    VAR previousThreeMonthStart=EOMONTH(dateValues,-4)+1
    RETURN 
    IF(MAX('case03'[Date])>=previousThreeMonthStart&&MAX('case03'[Date])<dateValues,1,0)
    

     

    like this:

    I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.

    Best Regards,

    Carson Jian,

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.