Forum Discussion

Paulompm's avatar
Paulompm
Frequent Visitor
9 years ago
Solved

Conditional percentage using DAX

Hello everyone,
need to get the percentage value that represents each day within the month by product type using dax formula(s). E.g.:

 

 

 

 

 

 

 

 

 

 

 

 

 Sample:

 

DateProduct TypeValue
04/01/2015Accessories 30,00 
04/01/2015WL 15.675,99 
04/01/2015Telephony 11.134,16 
04/06/2015WL 15.378,00 
04/06/2015Telephony 7.678,10 
04/07/2015WL 7.651,00 
04/07/2015Telephony 10.012,12 
04/07/2015Accessories 50,00 
04/09/2015WL 4.397,00 
04/09/2015Telephony 20.571,23 
Total  92.577,60 

 


I hope I have been clear in my problem. Thank you for your attention.

 

  • Hi Paulompm,

     

    I think this measure would give you your result you wish to have.

     

  • Paulompm

     

    Hi, try with this:

     

    %ByDay =
    SUMX (
        Table1,
        DIVIDE (
            CALCULATE ( SUM ( Table1[Value] ) ),
            CALCULATE ( SUM ( Table1[Value] ), ALLEXCEPT ( Table1,Table1[Product Type] ) )
        )
    )

3 Replies

  • Hi Paulompm,

     

    I think this measure would give you your result you wish to have.

     

    • Paulompm's avatar
      Paulompm
      Frequent Visitor

      actually it isn't working very well this measure. I have data for several years and I think the ALLEXCEPT Is mixing the years or month or both. I should get much higher percentage values.

       

      Exemple

       

       

  • Vvelarde's avatar
    Vvelarde
    Community Champion

    Paulompm

     

    Hi, try with this:

     

    %ByDay =
    SUMX (
        Table1,
        DIVIDE (
            CALCULATE ( SUM ( Table1[Value] ) ),
            CALCULATE ( SUM ( Table1[Value] ), ALLEXCEPT ( Table1,Table1[Product Type] ) )
        )
    )