cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Anonymous
Not applicable

matrix column subtotal

Incorrect post

Apologies

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: matrix column subtotal

Hi @Anonymous ,

 

We can use the new measure to meet your requirement, but it need to adjust by your own matrix field:

 

MyVlaues =
SUMX (
    ADDCOLUMNS (
        GROUPBY ( 'TableMain', TableMain[id], TableMain[id_2] ), // put all the row and column field of your matrix here
        "Value", IF (
            COUNTROWS (
                FILTER (
                    ALLSELECTED ( 'TableMain' ),
                    AND (
                        AND (
                            'TableMain'[id] = EARLIER ( [id] ),
                            'TableMain'[id_2] = EARLIER ( [id_2] )
                            // put all the row and column field condition of your matrix here
                        ),
                        [Position] = "-ve"
                    )
                )
            ) + 0 > 0,
            1,
            0
        )
    ),
    [Value]
)

1.PNG


BTW, pbix as attached.

 

Best regards,

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

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

View solution in original post

6 REPLIES 6
Highlighted
Community Support
Community Support

Re: matrix column subtotal

Hi @Anonymous ,

 

We can try to use the following measure to meet your requirement:

 

MyVlaues =
COUNTROWS ( FILTER ( 'TableMain', 'TableMain'[Position] = "-ve" ) )

If it doesn't meet your requirement, kindly share your sample data and expected result to me if you don't have any Confidential Information. Please upload your files to One Drive and share the link here.

 

Best regards,

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

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
Anonymous
Not applicable

Re: matrix column subtotal

Hi,
When I use your expression into the value of the matrix, it shows the same number in most of the cells which is incorrect

Highlighted
Community Support
Community Support

Re: matrix column subtotal

Hi @Anonymous ,

 

If this formula doesn't meet your requirement, Please show the exact expected result based on the Below Table.

 

31.PNG

 


BTW, pbix as attached.

 

Best regards,

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

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
Anonymous
Not applicable

Re: matrix column subtotal

Position value is either a 1 in case of "-ve" text, or 0 of other than "-ve" text
This bit in my matrix is fine, however, the total only shows 1 in some cases or 0 in other total. It is NOT summing the 1's in the row


@v-lid-msft wrote:

Hi @Anonymous ,

 

If this formula doesn't meet your requirement, Please show the exact expected result based on the Below Table.

 

31.PNG

 


BTW, pbix as attached.

 

Best regards,

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


 

Highlighted
Community Support
Community Support

Re: matrix column subtotal

Hi @Anonymous ,

 

We can use the new measure to meet your requirement, but it need to adjust by your own matrix field:

 

MyVlaues =
SUMX (
    ADDCOLUMNS (
        GROUPBY ( 'TableMain', TableMain[id], TableMain[id_2] ), // put all the row and column field of your matrix here
        "Value", IF (
            COUNTROWS (
                FILTER (
                    ALLSELECTED ( 'TableMain' ),
                    AND (
                        AND (
                            'TableMain'[id] = EARLIER ( [id] ),
                            'TableMain'[id_2] = EARLIER ( [id_2] )
                            // put all the row and column field condition of your matrix here
                        ),
                        [Position] = "-ve"
                    )
                )
            ) + 0 > 0,
            1,
            0
        )
    ),
    [Value]
)

1.PNG


BTW, pbix as attached.

 

Best regards,

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

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

View solution in original post

Highlighted
Anonymous
Not applicable

Re: matrix column subtotal

 

Helpful resources

Announcements
May 2020 Community Highlights

May 2020 Community Highlights

It’s time for another PBI Community recap!

Community Blog

Community Blog

Visit our Community Blog for articles, guides, and information created by fellow community members.

Using the Community

Using the Community

Need help with the Power BI Community? Our 'Using the Community' support articles are a great place to start.

Galleries

Galleries

Looking for inspiration on how to present your data? Need instructional videos? Check out our Galleries!

Top Solution Authors