Forum Discussion

MandoMongo's avatar
MandoMongo
Regular Visitor
2 years ago
Solved

Grouping Question

I'm trying to write a dax measure that will group Sales by Product.  I can see via a table with Sales and Product columns what the result should be... Yet the following measure is off somehow...
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi MandoMongo ,

     

    I want to confirm the valuable input provided by sjoerdvn . However, I noticed that more detail is needed to fully understand this.

     

    As sjoerdvn  said, you just need to put the fields product and gross sales into the table visual object and it shows the grouped results.

     


    If you want to verify that the filtered calculations are correct, you can create measure to do so.

    Measure =
    CALCULATE(SUM(financials[Gross Sales])),FILTER(ALL(financials),'financials'[Product] = "VTT" && 'financials'[Country] = "France"))


    MEASURE shows the same results as in the table, so it's grouping and summing correctly.

     

    Also, a deeper understanding of the concept of context may help you in solving the problem. Context is one of the most important DAX concepts to understand.There are two types of context in DAX: row context and filter context. We will first look at row contexts. More details can be found in the documentation: Learn DAX basics in Power BI Desktop - Power BI | Microsoft Learn.

     

    If your Current Period does not refer to this, please clarify in a follow-up reply.

     

    Best Regards,

    Clara Gong

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.