Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago

Help with Viewing Totals per week in matrix Table

I have a report that shows a planned date of how materials are needed for production and materials available in the warehouse
We will like to know when their will be a shortage of material weekly 
i want the report to Review week by week  based on the quantities sort from older to new ones, if I am going to be below zero anytime
For example,this material MACR7540-26 the material total shows 1,218, However, if i want to view it for this week with week ending december 3rd i will consider only the three dates underlined and the result will be
430+1-159-159-159=-$46(meaning there is a shortage and should be red
if there is a shortage per week(below zero) the subtotal in this matrix table should be a red and if not the subtotal should be coloured in green.
So more like i want the planned dates sorted from older to newer and the quantity per week based on the planned date so any date that is not within the planned date for that week won't be considered.
 
 

3 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous ,

    You can create a measure as below to get the week total:

    Week total =
    VAR _selmt =
        SELECTEDVALUE ( 'Table'[[Material] )
    VAR _seldesc =
        SELECTEDVALUE ( 'Table'[Material Description] )
    VAR _seluom =
        SELECTEDVALUE ( 'Table'[Base UOM] )
    VAR _selmrpe =
        SELECTEDVALUE ( 'Table'[MRP element] )
    VAR _selindi =
        SELECTEDVALUE ( 'Table'[ABC Indicator] )
    VAR _selpdate =
        SELECTEDVALUE ( 'Table'[Planned dates] )
    RETURN
        CALCULATE (
            COUNT ( 'Table'[Material] ),
            FILTER (
                ALLSELECTED ( 'Table' ),
                'Table'[Material] = _selmt
                    && 'Table'[Material Description] = _seldesc
                    && 'Table'[Base UOM] = _seluom
                    && 'Table'[MRP element] = _selmrpe
                    && 'Table'[ABC Indicator] = _selindi
                    && WEEKNUM ( 'Table'[Planned dates], 1 ) = WEEKNUM ( _selpdate, 1 )
            )
        )

    If the above one is not working, please provide some raw data in your table(s) (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

    How to upload PBI in Community

    Best Regards

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi  Anonymous ,

    Whether your problem has been resolved? If yes, could you please mark the helpful post as Answered? It will help the others in the community find the solution easily if they face the same problem as yours. Thank you.

    Best Regards

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi,

      Didnt really work for me, instead i decided to do a running total of the total materials and as such i could see each day the value went below a 0