Forum Discussion
Calculating a total value within a filtered context
I am having a trouble calculating a total value within a filtered context.
I want to calculate a total sales and total volume, within the filtered context.
How can I achieve this?
The total sales value within the filtered context is 29.56 is shown in the pic, but my total sales is showing 29.93.
↓This is the total sales calculation amounting to 29.93.
This calculation is not affected by the filtered context
In above filtered context, I am excluding new products as well as discontinued products and want to calculate the total sales and volume of products sold in both this year and last year.
Much appreciate the support!
hidenseek9 , Try using
dax
TotalSalesFiltered =
CALCULATE(
SUM('ACT Data'[Value]),
'ACT Data'[Phase] = "Actus",
'ACT Data'[Line Item] = "Net Sales",
NOT('ACT Data'[Brand] IN {"New Product", "Discontinued"}),
ALLEXCEPT(MasterMapping, MasterMapping[Macro Brand])
)TotalVolumeFiltered =
CALCULATE(
SUM('ACT Data'[Volume]),
'ACT Data'[Phase] = "Actus",
'ACT Data'[Line Item] = "Net Sales",
NOT('ACT Data'[Brand] IN {"New Product", "Discontinued"}),
ALLEXCEPT(MasterMapping, MasterMapping[Macro Brand])
)
5 Replies
- bhanu_gautamSuper User
hidenseek9 , Try using
dax
TotalSalesFiltered =
CALCULATE(
SUM('ACT Data'[Value]),
'ACT Data'[Phase] = "Actus",
'ACT Data'[Line Item] = "Net Sales",
NOT('ACT Data'[Brand] IN {"New Product", "Discontinued"}),
ALLEXCEPT(MasterMapping, MasterMapping[Macro Brand])
)TotalVolumeFiltered =
CALCULATE(
SUM('ACT Data'[Volume]),
'ACT Data'[Phase] = "Actus",
'ACT Data'[Line Item] = "Net Sales",
NOT('ACT Data'[Brand] IN {"New Product", "Discontinued"}),
ALLEXCEPT(MasterMapping, MasterMapping[Macro Brand])
) - AnonymousNot applicable
Hi hidenseek9,
Thanks for reaching out to the Microsoft fabric community forum.
It looks like you are looking for a way to calculate values from a filtered context. As bhanu_gautam, already responded to your query, please go through his response and check if it solves your issue.
I would also take a moment to thank bhanu_gautam, for actively participating in the community forum and for the solutions you’ve been sharing in the community forum. Your contributions make a real difference.
If I misunderstand your needs or you still have problems on it, please feel free to let us know.
Best Regards,
Hammad.
Community Support TeamIf this post helps then please mark it as a solution, so that other members find it more quickly.
Thank you.
- AnonymousNot applicable
Hi hidenseek9,
As we haven’t heard back from you, so just following up to our previous message. I'd like to confirm if you've successfully resolved this issue or if you need further help.
If yes, you are welcome to share your workaround and mark it as a solution so that other users can benefit as well. If you find a reply particularly helpful to you, you can also mark it as a solution.
If you still have any questions or need more support, please feel free to let us know. We are more than happy to continue to help you.
Thank you for your patience and look forward to hearing from you.- AnonymousNot applicable
Hi hidenseek9,
I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If my response has addressed your query, please accept it as a solution so that other community members can find it easily.
Thank you.