Forum Discussion

Rapports's avatar
Rapports
Icon for Helper I rankHelper I
2 years ago
Solved

SUM with filter

Hello, 

Please I have a problem to do the sum of seance planified by filiere can you please help me to create a mesure for that ? 

 

  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi  Rapports ,

     

    Create measure.

    If you want to calculate the full sum based on filtering, you can use the following function:

    Measure =
    SUMX(
        ALLSELECTED('Table'),'Table'[SeancePlanified])

    If you want to calculate the sum of the groupings based on filtering, you can use the following function:

    Measure2 =
    SUMX(
       FILTER( ALLSELECTED('Table'),'Table'[filiere]=MAX('Table'[filiere])),'Table'[SeancePlanified])

     

    Best Regards,

    Liu Yang

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

3 Replies

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

    Sorry Rapports 
    The requirement is not clear to me, can you please share shreenshot for your output. 
    You can try below DAX
    =CALCULATE(
                      SUM(
                              Column Name
                      ),
                     Filter(
                     Table Name,
                     Column Name)
    )


    • Rapports's avatar
      Rapports
      Icon for Helper I rankHelper I

      I want that when i filter by INFORMATIQUE APPLIQUEE 23-24 for exemple it give me the total of seance planified 13+26+22+28=89 

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi  Rapports ,

     

    Create measure.

    If you want to calculate the full sum based on filtering, you can use the following function:

    Measure =
    SUMX(
        ALLSELECTED('Table'),'Table'[SeancePlanified])

    If you want to calculate the sum of the groupings based on filtering, you can use the following function:

    Measure2 =
    SUMX(
       FILTER( ALLSELECTED('Table'),'Table'[filiere]=MAX('Table'[filiere])),'Table'[SeancePlanified])

     

    Best Regards,

    Liu Yang

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