Forum Discussion

Syndicate_Admin's avatar
Syndicate_Admin
Administrator
4 years ago
Solved

Filtered sum

Hello

I need to add the values of the column ("Inscrits") of the table ("Annexa2")

But segun un filtro: tabla "Fam_Act", column "Type" = "Workshops"

---------

Table "Annexa2" and "Fam_Act" are related through the "Fami_Act_Centre2" field

Thanks a lot!!

  • Syndicate_Admin ,The information you have provided is not making the problem clear to me. Can you please explain with an example.

    Appreciate your Kudos.

  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi Syndicate_Admin ,

     

    I think you want to calculate sum by Fami_Act_Centre2 and Type in "Fam_Act" table should equal to Workshops. 

    Try this code.

     

    Column = sumx(filter(Annexa2,Annexa2[Fami_Act_Centre2]=EARLIER(Fam_Act[Fami_Act_Centre2])&& Fam_Act[Type] ="Workshops" ) ,Annexa2[Registered] )

     

    Result is as below.

     

    Best Regards,
    Rico Zhou

     

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

     

  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi Syndicate_Admin ,

     

    Could you tell me if your problem has been solved? If it is, kindly Accept it as the solution. More people will benefit from it. Or you are still confused about it, please provide me with more details about your table and your problem or share me with your pbix file without sensitive data.


    Best Regards,

    Rico Zhou

6 Replies

  • Syndicate_Admin ,The information you have provided is not making the problem clear to me. Can you please explain with an example.

    Appreciate your Kudos.

  • Excuse me... that I have not explained myself very well

    I want to add the column "inscrits" of the first table, but only take into account the rows that in the related table "Fam_Act" put "Workshops"

    Table "Annexa2"

    Column 1Fami_Act_Centre2Registered
    AAA3
    BBB4

    "Fam_Act" table

    TypeFami_Act_Centre2
    WorkshopsAAA
    DiffusionBBB
    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi Syndicate_Admin ,

       

      I think you want to calculate sum by Fami_Act_Centre2 and Type in "Fam_Act" table should equal to Workshops. 

      Try this code.

       

      Column = sumx(filter(Annexa2,Annexa2[Fami_Act_Centre2]=EARLIER(Fam_Act[Fami_Act_Centre2])&& Fam_Act[Type] ="Workshops" ) ,Annexa2[Registered] )

       

      Result is as below.

       

      Best Regards,
      Rico Zhou

       

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

       

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi Syndicate_Admin ,

       

      Could you tell me if your problem has been solved? If it is, kindly Accept it as the solution. More people will benefit from it. Or you are still confused about it, please provide me with more details about your table and your problem or share me with your pbix file without sensitive data.


      Best Regards,

      Rico Zhou