Forum Discussion

rocky09's avatar
rocky09
Icon for Solution Sage rankSolution Sage
4 years ago
Solved

Matrix showing Wrong Totals

I am not sure what's wrong with this measure. But, showing wrong totals. Can anyone advise, how can I resolve this?

Measure here:

 

products> = CALCULATE(
   
                    [Overall_Sales],
                    FILTER(ALL('Products'),[Overall_Sales]>350000)
                  ,                VALUES(Products[Product Name])
                    )

 

 

Thank you in advance,

  • Hi, rocky09 

    Try this:

    products> =
    CALCULATE (
        SUM ( 'Products'[_Overall_Sales] ),
        FILTER (
            ADDCOLUMNS ( 'Products', "_Overall_Sales", [Overall_Sales] ),
            [_Overall_Sales] > 350000
        )
    )
    

    If this doesn't work for you, please consider sharing more details about it. And It would be great if there is a sample file without any sesentive information here.

     

    It makes it easier to give you a solution.

    1. Sample (dummy dataset) data as text, use the table tool in the editing bar
    2. Expected output from sample data
    3. Explanation in words of how to get from 1. to 2.

     

    Best Regards,
    Community Support Team _ Zeon Zheng

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

9 Replies

  • TheoC's avatar
    TheoC
    Icon for Community Champion rankCommunity Champion

    hi rocky09 

     

    You can try the following

     

    Measure = SUMX ( VALUES ( TableName[Region] ) , [Overall Sales] >350000 } )

     

    Hope this helps.

    Theo

     

    • rocky09's avatar
      rocky09
      Icon for Solution Sage rankSolution Sage

      TheoC 
      Thank you, I have also the Product Name column to add to the matrix. So, when I add Product Name, the above provided is not working.

      • TheoC's avatar
        TheoC
        Icon for Community Champion rankCommunity Champion

        Hi rocky09 

         

        Can you wrap the measure I gave you with CALCULATE ( [Measure] , ALLEXCEPT ( Table[Product Name] ) )?

         

        Apologies.  On phone and can't test syntax.

         

        Theo

         

  • Rocky,

     

    Have you checked the relationships in your model?  

  • Hi, rocky09 

    Try this:

    products> =
    CALCULATE (
        SUM ( 'Products'[_Overall_Sales] ),
        FILTER (
            ADDCOLUMNS ( 'Products', "_Overall_Sales", [Overall_Sales] ),
            [_Overall_Sales] > 350000
        )
    )
    

    If this doesn't work for you, please consider sharing more details about it. And It would be great if there is a sample file without any sesentive information here.

     

    It makes it easier to give you a solution.

    1. Sample (dummy dataset) data as text, use the table tool in the editing bar
    2. Expected output from sample data
    3. Explanation in words of how to get from 1. to 2.

     

    Best Regards,
    Community Support Team _ Zeon Zheng

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