We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now
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.
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)
Solved! Go to Solution.
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
)
Best Regards,
Dale
Hi @sgsukumaran,
Could you please mark the proper answers as solutions?
Best Regards,
Dale
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
)
Best Regards,
Dale
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 - It is the same as i have now. Thanks
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 57 | |
| 38 | |
| 33 | |
| 19 | |
| 16 |
| User | Count |
|---|---|
| 68 | |
| 66 | |
| 41 | |
| 34 | |
| 24 |