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

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

Reply
SandoLokuge
New Member

How to Create a Measure to Calculate % value by Row Total

Hi,

i am very new to PowerBi and DAX and self teaching how to use it for my work.

i have to track the KPI according to the work site and is haviing issues trying to get the % value of KPI with respct to the row toal of clients.

 

the Data looks like this

 

 

Site Clients Achived KPITotal Clients% Clients
AAAA1530 
BBBB78116 
CCCC2133 

 

 

I used the folwing Mesure to calculate Clients Achive KPI 1

Clients Achived KPI=CALCULATE(COUNTA('KPI_01'[KPI 1]), 'KPI_01' [KPI 1] IN {"Achived"})

 

I used The follwing Measure to calculate Total Clients

Total Clients=CountA(KPI_01[ClientID])

 

How do i calcualte the % clients who achived KPI as per Site

i did this using Pivots in Excel, would like to know how to do this in Power BI

 

tahnks inadvance

 

 

6 REPLIES 6
Anonymous
Not applicable

Hi @SandoLokuge ,

Sorry to disturb you...


But did I answer your question ? Please mark my reply as solution. Thank you very much.
If not, please upload some insensitive data samples and expected output.

Best Regards,
Eyelyn Qin

Anonymous
Not applicable

Hi @SandoLokuge ,

According to my understand, you want to calculate the % of Achieved KPI 1 / total clients based on each Site, right?

You could use the following formula:

Achived Count =
CALCULATE (
    COUNTROWS ( 'KPI_01' ),
    FILTER (
        ALL ( KPI_01 ),
        'KPI_01'[Site] = MAX ( 'KPI_01'[Site] )
            && 'KPI_01'[KPI 1] = "Achived"
    )
)
/ CALCULATE ( COUNTROWS ( 'KPI_01' ), ALLEXCEPT ( KPI_01, KPI_01[Site] ) )

My visualization looks like this:

9.17.1.1.png

Did I answer your question ? Please mark my reply as solution. Thank you very much.

If not, please upload some insensitive data samples and expected output.

 

Best Regards,

Eyelyn Qin

amitchandak
Super User
Super User

@SandoLokuge , a new measure like

divide([Clients Achived KPI],[Total Clients])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hi Amit,

I tried using the divide fuction but it gives me 1 in every row.

i need the clients who achived the KPI divided by total clients for that row

thank you

@SandoLokuge ,Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hi Amit,

 

The Raw Data Looks like this for KPI 1

Clients IDSiteKPI 1
111AAAAAchieved
222BBBBNot Achieved
3333AAAAAchieved
444CCCCAchieved

 

I have another Table for all the sites so that i can cross refrence for other KPIs im tracking per site

 

SITE

AAAA
BBBB

CCCC

 

Hope this makes sense

 

Helpful resources

Announcements
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.

Top Kudoed Authors