Forum Discussion

setiawanan9's avatar
setiawanan9
Frequent Visitor
4 years ago
Solved

DAX Calculate without dependency to selected filter

Hi everyone,

 

I'm trying to figure out how to solve case like this :

A. Table to show total sales each customer

B. Table to show total sales each month based on customer selected from table A and show total sales each month without dependency to customer selected from table A. so these two measures will show comparison of sales each customer selected monthly vs total all sales monthly side by side in table B

 

Any help is appreciated .. Thanks !

 

 

 

 

 

 

  • v-kkf-msft's avatar
    v-kkf-msft
    4 years ago

    Hi setiawanan9 ,

     

    Please try the following formula:

     

    Measure = 
    CALCULATE (
        SUM ( INV1[Sales] ),
        FILTER (
            ALL ( INV1 ), 
            FORMAT ( INV1[Date], "mmmm" ) = MAX ( 'Calendar'[Month] )
        )
    )

     

    If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
    Best Regards,
    Winniz
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

     

4 Replies

    • setiawanan9's avatar
      setiawanan9
      Frequent Visitor

       

      parry2kThanks for your suggestion, so the measure is INV1.Linetotal, table A shows measures INV1.Linetotal (sales value) and OCRD.CardCode (customer name).

       

      Table B will interact with table A. When table A is selected,  table B should show INV1.Linetotal, Calendar.Month and another new measure known as  “All Sales” that show monthly total sales from all customer. The problem is how to formulate the DAX for “All Sales”.

       

      Thank you !

      • v-kkf-msft's avatar
        v-kkf-msft
        Icon for Community Support rankCommunity Support

        Hi setiawanan9 ,

         

        Please try the following formula:

         

        Measure = 
        CALCULATE (
            SUM ( INV1[Sales] ),
            FILTER (
                ALL ( INV1 ), 
                FORMAT ( INV1[Date], "mmmm" ) = MAX ( 'Calendar'[Month] )
            )
        )

         

        If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
        Best Regards,
        Winniz
        If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.