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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
Anonymous
Not applicable

Percentage of two categories

Hello everyone,

I am having trouble showing the percentage of a percentage of a column. I have 2 columns "State" and "Iteration Path", once i filter the Iteration Path it shows how it suppose to with a 100% total, but when i try to filter again by State to show the percentage that i had before (for example, filtering closed sprint 9 instead of showing 38.30%, it shows a 100% total again). I tried taking the ALLSELECTED to ALL and it does not work, like it is shown in the images.

 

First images shows with ALLSELECTED, and the third image it shows with ALL.

 

ALLSELECTEDALLSELECTEDDAXDAXALL insted of ALLSELECTEDALL insted of ALLSELECTED

 

 

1 ACCEPTED SOLUTION
V-pazhen-msft
Community Support
Community Support

@Anonymous 

If I understand your video correctly, you want it to auto calculate the % when filer to banana but what it to stop calculate when filter to B. Check the example below see if helps.

 

Yes % =
var yes = [Yes]
var sales= CALCULATE(COUNTROWS('Table'),FILTER(ALL('Table'),[Sales]="Yes"&&'Table'[Fruit]=MAX([Fruit])))
Return yes/sales

V-pazhen-msft_0-1623308817827.png

 

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

 

View solution in original post

5 REPLIES 5
V-pazhen-msft
Community Support
Community Support

@Anonymous 

If I understand your video correctly, you want it to auto calculate the % when filer to banana but what it to stop calculate when filter to B. Check the example below see if helps.

 

Yes % =
var yes = [Yes]
var sales= CALCULATE(COUNTROWS('Table'),FILTER(ALL('Table'),[Sales]="Yes"&&'Table'[Fruit]=MAX([Fruit])))
Return yes/sales

V-pazhen-msft_0-1623308817827.png

 

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

 

parry2k
Super User
Super User

@Anonymous I cannot work with images and put my efforts to understand them. You can always create dummy data and explain it. If you cannot do this then unfortunately it is hard to provide a solution. Good luck. 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Anonymous
Not applicable

 

Video explaining the issue.

 

DAX

YES COUNT =
CALCULATE(COUNTROWS(Sheet1), Sheet1[Sales] = "YES")

 

YES % =
VAR Sale = [YES Sales]
VAR Currentsale = CALCULATE([YES Sales], ALLSELECTED(Sheet1))
RETURN
DIVIDE (Sale,Currentsale)

 

 

parry2k
Super User
Super User

@Anonymous very hard to follow your images, can you share the sample data and explain what you are looking for?



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Anonymous
Not applicable

I cannot share the data since its confidential. So in this image we have a TOTAL percentage for Sprint 9, the percentage is divided by 3 "States", Active, Closed and New. This 3 show their percentage to make up for the TOTAL, which is okay. But then when i try to isolate for example "Closed" it does not show the 38.30% it showed before, instead it shows a 100%. So what i need is to be able to isolate those percentage numbers so i can show them in a card.

 

Categories.png

 

 

 

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

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

PBI_Carousel_NL_June

Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.

Top Solution Authors