cancel
Showing results for 
Search instead for 
Did you mean: 
Reply

Calculated % measure

Hello, 

 

I have problems creating a measure, i want to show on a line chart the percentage of "orders on time" (1).

My power bi table looks like the first one with orders and itmes, and when I make this measure the result is 63%, but it really should be 60% , because it depens on the number of orders, not the number of itmes in the order.

 

My measure is sum(time)/count(order) = 7/11, and should be 3/5

 

How can I make the measure, without loosing the item column?

Capturafe.PNGPlease I need Help

1 ACCEPTED SOLUTION

Accepted Solutions
Microsoft v-cherch-msft
Microsoft

Re: Calculated % measure

Hi @christianyepez2

 

You may create measure as below:

Measure =
COUNTROWS ( SUMMARIZE ( FILTER ( Table1, Table1[Time] = 1 ), Table1[Order] ) )
    / DISTINCTCOUNT ( Table1[Order] )

aa.png

 

Regards,

Cherie

Community Support Team _ Cherie Chen
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

2 REPLIES 2
Super User III
Super User III

Re: Calculated % measure

@christianyepez2

 

Try this one

 

Measure =
VAR orderswithTime1 =
    COUNTROWS (
        FILTER ( VALUES ( Table1[Order] ), CALCULATE ( SUM ( Table1[Time] ) ) > 0 )
    )
VAR TotalOrders =
    COUNTROWS ( VALUES ( Table1[Order] ) )
RETURN
    DIVIDE ( orderswithTime1, TotalOrders )
Try my new Power BI game Cross the River
Microsoft v-cherch-msft
Microsoft

Re: Calculated % measure

Hi @christianyepez2

 

You may create measure as below:

Measure =
COUNTROWS ( SUMMARIZE ( FILTER ( Table1, Table1[Time] = 1 ), Table1[Order] ) )
    / DISTINCTCOUNT ( Table1[Order] )

aa.png

 

Regards,

Cherie

Community Support Team _ Cherie Chen
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

Helpful resources

Announcements
Meet the 2020 Season 1 Power BI Super Users!

Meet the 2020 Season 1 Power BI Super Users!

It’s the start of a new Super User season! Learn all about the new Super Users and brand-new tiered recognition system.

Super User Challenge: Can You Solve These?

Super User Challenge: Can You Solve These?

We're celebrating the start of the New Super User season with our first ever Super User 'Can You Solve These?' challenge.

Power BI Desktop Update - February 2020

Power BI Desktop Update - February 2020

We are super excited for our update this month, as we are releasing two of our top community requests!

Power Platform Online Conference

Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

Top Solution Authors