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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
JWick1969
Helper IV
Helper IV

Divide each row value with total row total

 

Hi,

 

I have a matrix with "fg year and month rows"  and "received date" in the column.

the matrix shows the count of fg in each received month. I want to add a % for each value using the fg total row (row level value divided by fg total value. 

 

Example data like below.

Oct 2021 rows and Oct 2021 column the % should be 100%(4622/fg total 6422)

Nov 2021 row and Oct 2021 column the % should be  59.04%(4652/fg total 7883), Nov 2021 column 40.96%(3229/7883)

and so on...  


Trying out this code and gives me wrong % value.

DIVIDE(SUM(table[FG count]),CALCULATE(SUM(table[FG Count]),ALLEXCEPT(table,table[DateFG])),0)

 

JWick1969_1-1653657499899.png

Appreciate any help.

 

Kindest regards

 

 

1 ACCEPTED SOLUTION

Hi @v-jayw-msft , already resolved the issue. Please see below the code. btw, thanks for the reply.

% of total =

VAR fg_volume = CALCULATE([fg count],ALL(table[Receipt Month]), ALL(table[FG date]))
RETURN DIVIDE([fg]fg_volume)

View solution in original post

2 REPLIES 2
v-jayw-msft
Community Support
Community Support

Hi @JWick1969 ,

 

What is the [DateFG] in the formula?

As I can see from the screenshot, the row total should be:

CALCULATE (
    SUM ( 'table'[FG Count] ),
    FILTER (
        ALL ( 'table' ),
        'table'[year] = SELECTEDVALUE ( 'table'[year] )
            && 'table'[month] = SELECTEDVALUE ( 'table'[month] )
    )
)

 

Best Regards,

Jay

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

Hi @v-jayw-msft , already resolved the issue. Please see below the code. btw, thanks for the reply.

% of total =

VAR fg_volume = CALCULATE([fg count],ALL(table[Receipt Month]), ALL(table[FG date]))
RETURN DIVIDE([fg]fg_volume)

Helpful resources

Announcements
Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan NL Carousel

Fabric Community Update - January 2025

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