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
Tmurphy
Frequent Visitor

Percentage derived from values stored in 1 column

Hola Power Bi Gurus

 

I currently have a Matrix thats pulling 3 sources 

-PHASES

-STATUS

-COUNT

Tmurphy_1-1674058539374.png

 

In the Matrix the "STATUS" splits the 2 statues "Installed" & "Not Installed"

 

I am having an issue of taking the "Installed" count and cacluating a percentage based off the Total. So in theory 

PH0 would have a percentage of 9% (Based off of 24/65=.0905)

I added a text box off to the side of matrix for the result i am looking for. 

 

Any Help is much apperciated!

 

 

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

Hi , @Tmurphy 

According to your needs provided and your current screenshot, after my testing and research, if you want to achieve the current demand situation, you may want to slightly adjust the schema of the field placement of your matrix, you can refer to my scheme, my test data is created according to the screenshot provided by you:

Installed =SUMX(FILTER('Table','Table'[STATUS]="Installed"),'Table'[COUNT])
Not Installed =SUMX(FILTER('Table','Table'[STATUS]="Not Installed"),'Table'[COUNT])
Percentage Complete =var _installed=SUMX(FILTER(ALLSELECTED('Table'),'Table'[PHASE]=MAX('Table'[PHASE])&&'Table'[STATUS]="Installed"),'Table'[COUNT])var _NotInstalled=SUMX(FILTER(ALLSELECTED('Table'),'Table'[PHASE]=MAX('Table'[PHASE])&&'Table'[STATUS]="Not Installed"),'Table'[COUNT])var _All=SUMX(FILTER(ALLSELECTED('Table'),'Table'[PHASE]=MAX('Table'[PHASE])),'Table'[COUNT])returnDIVIDE(_installed,_All)

 

You can go to the matrix, remove the fields from the "Column" bucket, and then put three newly created measures in the "Value" bucket, in which case your needs can be perfectly realized:

vyueyunzhmsft_0-1674097848668.png

Thank you for your time and sharing, and thank you for your support and understanding of PowerBI! 

 

Best Regards,

Aniya Zhang

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

4 REPLIES 4
v-yueyunzh-msft
Community Support
Community Support

Hi , @Tmurphy 

According to your needs provided and your current screenshot, after my testing and research, if you want to achieve the current demand situation, you may want to slightly adjust the schema of the field placement of your matrix, you can refer to my scheme, my test data is created according to the screenshot provided by you:

Installed =SUMX(FILTER('Table','Table'[STATUS]="Installed"),'Table'[COUNT])
Not Installed =SUMX(FILTER('Table','Table'[STATUS]="Not Installed"),'Table'[COUNT])
Percentage Complete =var _installed=SUMX(FILTER(ALLSELECTED('Table'),'Table'[PHASE]=MAX('Table'[PHASE])&&'Table'[STATUS]="Installed"),'Table'[COUNT])var _NotInstalled=SUMX(FILTER(ALLSELECTED('Table'),'Table'[PHASE]=MAX('Table'[PHASE])&&'Table'[STATUS]="Not Installed"),'Table'[COUNT])var _All=SUMX(FILTER(ALLSELECTED('Table'),'Table'[PHASE]=MAX('Table'[PHASE])),'Table'[COUNT])returnDIVIDE(_installed,_All)

 

You can go to the matrix, remove the fields from the "Column" bucket, and then put three newly created measures in the "Value" bucket, in which case your needs can be perfectly realized:

vyueyunzhmsft_0-1674097848668.png

Thank you for your time and sharing, and thank you for your support and understanding of PowerBI! 

 

Best Regards,

Aniya Zhang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

THANK YOU SO MUCH! This fixed my issue. MUCH APPRECIATED. 

amitchandak
Super User
Super User

@Tmurphy ,

You can measure like

Assume you have count measure

 

divide([count], calculate([count], removefilters(Table[Status])) )

 

Percent of Total and Percent of SubTotal https://www.youtube.com/watch?v=6jTildcV2ho
https://www.youtube.com/watch?v=cN8AO3_vmlY&t=24270s

 

You can use isinscope to change grand total

 

if(isinscope(Table[Status]), [Count], divide([count], calculate([count], removefilters(Table[Status])) ) )

Apperciate the response but this did not work for me. I am sure its something i did as i am still learning how to use the software. 

 

 

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.