The formula below is used as an example in the video Mastering Dax calculations --> Calculate Statement --> Simple and advanced filters
Profit of High Margin customers = CALCULATE( [Total Profits] , FILTER( CustomerT, [Total Margin %] > 0.32))
Total Profits is calculated as Quantity * (Sales Unit Price - Cost Price) within a SUMX formula
Total Margin % = Total Profits / Total Sales
Question about the formula :
If you use this measure in a table, with the date in the rows, the Profit of High Margin Customers per row is correct, but the TOTAL is not if you select a significant period. Why not ?
If the margin in the Filter formula is increased from 32% to 52 %, the total in the table for this measure disappear completely, why ?
Thanks in advance for your guidance and solution !
Regarding the first question. The totals get the wrong answer sometimes because it takes the sum of profit of the period and divides it by the sales of the periode (instead of calculating a margin per row). But if you want to get a correct total, you can add another measure with a SUMMARIZE function and SUMX.
For the second i guess because the overall %margin (Total profil / Total sales) is under 52% that’s why it shows blank.
If u have a pbix file so that we can verify this, it would be better
Hi @deltaselect, we aim to consistently improve the topics being posted on the forum to help you in getting a strong solution faster. While waiting for a response, here are some tips so you can get the most out of the forum and other Enterprise DNA resources.
Use the forum search to discover if your query has been asked before by another member.
When posting a topic with formula make sure that it is correctly formatted to preformatted text </>.
Use the proper category that best describes your topic
Provide as much context to a question as possible.
Include the masked demo pbix file, images of the entire scenario you are dealing with, screenshot of the data model, details of how you want to visualize a result, and any other supporting links and details.
To fix the totals issue, one of our expert @Greg had created a specific post onto the forum which addresses this exact same issue. The post contains the used cases of scenarios as well as the link of the videos about how to fix them.
Below is the link provided for the reference.
Hoping you’ll find this useful and helpful and will meet your requirements that you’ve been looking for.
Note:To view the entire post, please click onto the link and not onto the “expand/collapse” button.