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

July 28 - August 9 | Final Round of the Power BI Dataviz World Championships. This is your chance. Learn more

Reply
sgsukumaran
Resolver II
Resolver II

Average Calculation

 

I am trying to calulate ratio based on unique values on another column.  Eventually I want to sum the offset only based on unique "pick ticket contol number" and divide it by discount count of  "pick ticket contol number".  Based on the data below for a distinct pickticket number the % would be  (0+1)/2(distinct count) = 50%. Any help is highly appreciated.

Capture.PNG

 

 

 

 

 

Warehouse Processing %:=
DIVIDE (
CALCULATE (
SUM ( [Warehouse Processing Offset] ),
'Orders'[DC Ready To Ship Date] <> BLANK ()
),
CALCULATE (
DISTINCTCOUNT(Orders[Pick Ticket Control Number] ),
'Orders'[DC Ready To Ship Date] <> BLANK ()
),
0)

 

1 ACCEPTED SOLUTION
v-jiascu-msft
Microsoft Employee
Microsoft Employee

Hi @sgsukumaran,

 

Try this formula, please. If it doesn't work, please share a dummy sample file.

Warehouse Processing % =
DIVIDE (
    CALCULATE (
        SUMX (
            SUMMARIZE (
                Orders,
                Orders[Pick Ticket Control Number],
                Orders[Warehouse Processing Offset]
            ),
            [Warehouse Processing Offset]
        ),
        ALL ( Orders )
    ),
    CALCULATE (
        DISTINCTCOUNT ( Orders[Pick Ticket Control Number] ),
        ALL ( Orders )
    ),
    0
)

Average_Calculation

 

Best Regards,

Dale

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

6 REPLIES 6
v-jiascu-msft
Microsoft Employee
Microsoft Employee

Hi @sgsukumaran,

 

 

Could you please mark the proper answers as solutions?

Best Regards,
Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
v-jiascu-msft
Microsoft Employee
Microsoft Employee

Hi @sgsukumaran,

 

Try this formula, please. If it doesn't work, please share a dummy sample file.

Warehouse Processing % =
DIVIDE (
    CALCULATE (
        SUMX (
            SUMMARIZE (
                Orders,
                Orders[Pick Ticket Control Number],
                Orders[Warehouse Processing Offset]
            ),
            [Warehouse Processing Offset]
        ),
        ALL ( Orders )
    ),
    CALCULATE (
        DISTINCTCOUNT ( Orders[Pick Ticket Control Number] ),
        ALL ( Orders )
    ),
    0
)

Average_Calculation

 

Best Regards,

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

I am assuming that the logic in your DAX is the intended logic.

 

If so, please break the individual numerator and denominator as variables and then use the variables in the divide function.

 

https://www.sqlbi.com/articles/variables-in-dax/

 

Please let me know if this helps.

@Anonymous This should return the same result. What is different here?

Anonymous
Not applicable

My apologies.

 

I hope you will find this link useful. 

@Anonymous - It is the same as i have now. Thanks

Helpful resources

Announcements
Fabric Community Sticker Design Challenge Barcelona Carousel

Fabric Community Sticker Challenge - Barcelona 2026

If you love stickers, then you will definitely want to check out our community sticker challenge, Barcelona edition!

July Power BI Update Carousel

Power BI Monthly Update - July 2026

Check out the July 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors