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

Sum specific row then divide to the Total rows

How to create a measure that will sum "Hit" and "Missed" and then will be divided to the Total.

So it will be (2350 + 150) / 6219 = 40.20% (I need percentage).

 

target.PNG

 

Thank you all in advance!

 

 

1 ACCEPTED SOLUTION

Hey,

 

I'm sorry, i forgot to mention the base measure I created and that is used in all the ohter measures:

Count Target = 
COUNT('Table1'[Target]) 

Sorry

Tom

 

 



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

View solution in original post

6 REPLIES 6
Johanno
Continued Contributor
Continued Contributor

Hi, what about:

Percentage hit or missed = CALCULATE(SUM(Table1[Count of target]);Table1[Target]="Hit" || Table1[Target]="Missed")/SUM(Table1[Count of target])

/Johan

Hi @Johanno

 

thanks for the quick response, unfortunately [Count of target] is not a column. It is the Target column itself.

Hey,

 

I created these 3 measures:

the numerator

Count Target Hit and Missed = 
CALCULATE(
    [Count Target]
    ,ALL('Table1'[Target])
    ,OR('Table1'[Target] = "Hit", 'Table1'[Target] = "Missed")
)

the denominator

Count Target ALL = 
CALCULATE(
    COUNT('Table1'[Target]) 
    ,ALL(Table1[Target])
)

and finally the division

the Ratio = 
DIVIDE([Count Target Hit and Missed], [Count Target ALL], BLANK())

using all these measure on a table creates this

image.png

 

Maybe this is what you are looking for

 

Regards

Tom

 



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

Hi @TomMartens

 

What's the [Count Target] under the 'Count Target Hit and Missed' stands for? When I tried the formula it says that the "value for 'Count Target' cannot be determined.

 

Thanks

Hey,

 

I'm sorry, i forgot to mention the base measure I created and that is used in all the ohter measures:

Count Target = 
COUNT('Table1'[Target]) 

Sorry

Tom

 

 



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

 

 

Thanks @TomMartens it worked!

You're a genius!

Helpful resources

Announcements
Sept PBI Carousel

Power BI Monthly Update - September 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

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

Top Solution Authors
Top Kudoed Authors