Reply
DBPropest
New Member
Partially syndicated - Outbound

Divide Filtered Matrix Column by Total

Hello,

 

I am new to the forum and have some experience using power bi. Please refer to the image for 

 

Question: How can I divide the yes column by the total for creating a new measure?

 

Example: for December 2022 there were 393 "yes" and 1308 "total" and I am trying to create a measure that divides the 393/1308 for a percentage of 30%.

 

I am trying to add an additional column for that percentage.

 

Thanks.

 

power bi.PNG

 

1 ACCEPTED SOLUTION
v-shex-msft
Community Support
Community Support

Syndicated - Outbound

HI @DBPropest,

You can try to use the following measure formula if it suitable for your requirement:

formula =
DIVIDE (
    CALCULATE (
        COUNT ( Table[Image] ),
        ALLSELECTED ( Table ),
        VALUES ( Table[Month] ),
        VALUES ( Table[Image] )
    ),
    CALCULATE (
        COUNT ( Table[Image] ),
        ALLSELECTED ( Table ),
        VALUES ( Table[Month] )
    )
)

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

2 REPLIES 2
v-shex-msft
Community Support
Community Support

Syndicated - Outbound

HI @DBPropest,

You can try to use the following measure formula if it suitable for your requirement:

formula =
DIVIDE (
    CALCULATE (
        COUNT ( Table[Image] ),
        ALLSELECTED ( Table ),
        VALUES ( Table[Month] ),
        VALUES ( Table[Image] )
    ),
    CALCULATE (
        COUNT ( Table[Image] ),
        ALLSELECTED ( Table ),
        VALUES ( Table[Month] )
    )
)

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
Priya1969
Resolver I
Resolver I

Syndicated - Outbound

Sample Data:

ImageValueMonth
Yes500January
No600February
Yes300March
No200April
Yes300May
Yes250April
No100January
Yes50February
No120March
No80May

 

1. Select the Transform button on the top and go to the power query. There select, the month column, then select pivot option. It will change your data format.

2.  Select Add column- custom column - give formula yes+no and enter ok. It will give total value.

3. Again select add column-custom column - give formula yes/new custom column. It will give desire value. Then, changed the data type to % and rename the column name.

Out Put:

Priya1969_0-1672360221523.png

Now, select the Matix visual, like below, you will get the desired out put.

 

Priya1969_1-1672360314601.png

 

   

 

avatar user

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

Feb2025 NL Carousel

Fabric Community Update - February 2025

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

Top Solution Authors (Last Month)
Top Kudoed Authors (Last Month)