Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
Hi guys,
Im quite new here really appreciate your help.
I have a Orders table comprise of Sales, Outlets, and Outlet_Size columns. I'm trying to calculate the rate, which is something like this DIVIDE(SUM(Orders[Sales],Sales[Outlet_Size]). But how do I write a query that can divide a total of all columns, to one single value depending on which outlet ?
Appreciate your help !
Thank you
Solved! Go to Solution.
Hi @naufal_msr ,
Like this?
Best Regards,
Community Support Team _ Yingjie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hello, please can you provide some dummy data to better understand what you are trying to achieve? An example of the calculation you want to perform will help to better understand the outcome you are seeking. Thanks.
Hey thanks for your reply.
Suppose my data looks like this :
| Sale (USD) | Outlets | Outlets Size (Sqft) |
| 10 | A | 500 |
| 15 | A | 500 |
| 10 | B | 1500 |
| 20 | C | 1000 |
| 10 | B | 1500 |
| 30 | C | 1000 |
What I'm trying to look for is the totalsales/outletsize (USD/sqft). So it'll work by grouping them into their outlets (A/B/C), sum up the total sales, and divide by their respective outlet size. So for outlet A it'll be 25(USD)/500(sqft) and etc.
Sorry if my explanations and examples are not that well. Appreciate all the help I can get.
Thanks !
Hi @naufal_msr ,
Since you have the same row value in the table, recommend that you can create a calculated column like this:
Result =
DIVIDE (
CALCULATE (
SUM ( 'Table'[Sale (USD)] ),
ALLEXCEPT ( 'Table', 'Table'[Outlets Size (Sqft)] )
),
CALCULATE (
MIN ( 'Table'[Outlets Size (Sqft)] ),
ALLEXCEPT ( 'Table', 'Table'[Outlets Size (Sqft)] )
)
)
Best Regards,
Community Support Team _ Yingjie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Yingjie Li,
Thanks this actually helps. But i guess I should mention that I needed this to work with my date range filter. There's also a date column. How do I apply this formula if there are date filter in it ?
| Date | Sale (USD) | Outlets | Outlets Size (Sqft) |
| 1/1/2021 | 10 | A | 500 |
| 1/1/2021 | 15 | A | 500 |
| 2/1/2021 | 20 | A | 500 |
| 2/1/2021 | 25 | A | 500 |
| 1/1/2021 | 10 | B | 1500 |
| 1/1/2021 | 15 | B | 1500 |
| 1/1/2021 | 20 | C | 1000 |
| 2/1/2021 | 10 | B | 1500 |
| 2/1/2021 | 30 | C | 1000 |
Thank you !
Hi @naufal_msr ,
Like this?
Best Regards,
Community Support Team _ Yingjie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
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 |
|---|---|
| 9 | |
| 6 | |
| 3 | |
| 2 | |
| 2 |
| User | Count |
|---|---|
| 21 | |
| 12 | |
| 9 | |
| 5 | |
| 5 |