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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
apolo
New Member

BI - How to calculate the percentage of a specific value where the total is the same column

Good morning, everyone,

 

I have a column in my report called STATUS, which counts 3 values: "OUT OF DEADLINE", "NO DEADLINE" and "ON DEADLINE".

 

I'm trying to create a card that indicates the percentage of "ON DEADLINE" in relation to the total. But I can't do it. Does anyone have any idea? It needs to be done using the card view.

 

I managed to get it to calculate, but by counting. Not by percentage.

 

Medida = CALCULATE(COUNTA('Relatório SLA'[SITUACAO]),'Relatório SLA'[SITUACAO] IN { "NO PRAZO" })

 

Thank you in advance for your time, translated by Google translator, sorry for any mistakes.

 

Here is a brief example:

 

TRANSLATION

SITUAÇÃO = SITUATION

NO PRAZO = ON DEADLINE

SEM PRAZO = NO DEADLINE

FORA DO PRAZO = OUT OF DEADLINE

 

Imagem.png

2 ACCEPTED SOLUTIONS
bhanu_gautam
Super User
Super User

@apolo Create a measure to count the total number of statuses.
Create a measure to count the number of "ON DEADLINE" statuses.
Create a measure to calculate the percentage of "ON DEADLINE" statuses.

 

TotalStatus = COUNTA('Relatório SLA'[SITUACAO])

 

OnDeadlineCount = CALCULATE(COUNTA('Relatório SLA'[SITUACAO]), 'Relatório SLA'[SITUACAO] = "NO PRAZO")

 

OnDeadlinePercentage = DIVIDE([OnDeadlineCount], [TotalStatus], 0)




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






View solution in original post

v-dineshya
Community Support
Community Support

Hi @apolo ,

Thanks for reaching out to the Microsoft fabric community forum.

 

DAX code for percentage of "ON DEADLINE" in relation to the total.

Percentage On Deadline =
VAR TotalCount = CALCULATE(COUNTROWS('Relatório SLA'))
VAR OnDeadlineCount = CALCULATE(COUNTROWS('Relatório SLA'), 'Relatório SLA'[SITUACAO] = "NO PRAZO")
RETURN
IF(
TotalCount = 0,
0,
DIVIDE(OnDeadlineCount, TotalCount, 0)
)


After creating the measure, go to the "Modeling" tab in Power BI. Select the measure and choose the "Percentage" format.

 

If you find this post helpful, please mark it as an "Accept as Solution" and consider giving a KUDOS. Feel free to reach out if you need further assistance.
Thanks and Regards

View solution in original post

6 REPLIES 6
v-dineshya
Community Support
Community Support

Hi @apolo ,

Thanks for reaching out to the Microsoft fabric community forum.

 

DAX code for percentage of "ON DEADLINE" in relation to the total.

Percentage On Deadline =
VAR TotalCount = CALCULATE(COUNTROWS('Relatório SLA'))
VAR OnDeadlineCount = CALCULATE(COUNTROWS('Relatório SLA'), 'Relatório SLA'[SITUACAO] = "NO PRAZO")
RETURN
IF(
TotalCount = 0,
0,
DIVIDE(OnDeadlineCount, TotalCount, 0)
)


After creating the measure, go to the "Modeling" tab in Power BI. Select the measure and choose the "Percentage" format.

 

If you find this post helpful, please mark it as an "Accept as Solution" and consider giving a KUDOS. Feel free to reach out if you need further assistance.
Thanks and Regards

Hi @apolo ,

Thank you for reaching out to the Microsoft Community Forum.

 

If my response has resolved your query, please mark it as the Accepted Solution to assist others. Additionally, a 'Kudos' would be appreciated if you found my response helpful.

 

Thank you

Hi @apolo ,

Thank you for reaching out to the Microsoft Community Forum.

 

If my response has resolved your query, please mark it as the Accepted Solution to assist others. Additionally, a 'Kudos' would be appreciated if you found my response helpful.

 

Thank you

Hi @apolo ,

Thank you for reaching out to the Microsoft Community Forum.

 

If my response has resolved your query, please mark it as the Accepted Solution to assist others. Additionally, a 'Kudos' would be appreciated if you found my response helpful.

 

Thank you

KiranKusmude
Regular Visitor

A% =
var cnt=CALCULATE(COUNT('Table'[Column1]),all('Table'[Column1]))
var _Acnt= CALCULATE(COUNT('Table'[Column1]),'Table'[Column1]="A")
return
divide(_Acnt,cnt)
bhanu_gautam
Super User
Super User

@apolo Create a measure to count the total number of statuses.
Create a measure to count the number of "ON DEADLINE" statuses.
Create a measure to calculate the percentage of "ON DEADLINE" statuses.

 

TotalStatus = COUNTA('Relatório SLA'[SITUACAO])

 

OnDeadlineCount = CALCULATE(COUNTA('Relatório SLA'[SITUACAO]), 'Relatório SLA'[SITUACAO] = "NO PRAZO")

 

OnDeadlinePercentage = DIVIDE([OnDeadlineCount], [TotalStatus], 0)




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.