Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
Anonymous
Not applicable

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
Wealthj_0-1669656102810.png
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
Wealthj_1-1669656167406.png
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 3
v-yiruan-msft
Community Support
Community Support

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

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
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

v-yiruan-msft
Community Support
Community Support

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

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

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.