Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago

Calculate multiple values based on different values in DAX

Hi guys,

 

I have one table which register the total contact registrations for each employee on each contact type. We have three different contact type: call, e-mail and inmail.

 

My current limited dax formula is : 

Total contactregistrations= COUNT(Fact_Contact[contactmomentid])

And tried to make a measure to make the calculation based on contact type :
MeasureB=
IF(SELECTEDVALUE(Dim_ContactType[Type]) = "Call",
IF(SELECTEDVALUE(Dim_ContactType[Type]) = "E-mail",
IF(SELECTEDVALUE(Dim_ContactType[Type]) = "InMail",
[Total contactregistrations])))
 
My questions is how to make the measureB more flexibel to return if there is a contact registration with call, e-mail or inmail then sum the contact registrations.
 
Any suggestions?
 
Many thanks!
 

 

 

8 Replies

  • Anonymous 

    If I understand your question correctly,

    When you use your Measure "COUNT(Fact_Contact[contactmomentid])", and drop it in a table visual where you already have Dim_ContactType[Type], it should automatically give you the result you are expecting as the filter context works.

    ________________________

    Did I answer your question? Mark this post as a solution, this will help others!.

    I accept KUDOS 🙂

    YouTube, LinkedIn

    • Anonymous's avatar
      Anonymous
      Not applicable

      Fowmy Exactly ! any suggestions?

  • Anonymous add the following measure

     

    New Measure = CALCULATE ([Total contactregistrations],
    Dim_ContactType[Type]) IN { "Call",
    "E-mail",
    "InMail"}
    )

    I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!

    Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.

    • Anonymous's avatar
      Anonymous
      Not applicable

      parry2k Your formula doesnt match with my expexted result:

       

      It returns  the following wrong result: 

      wrong
      But i expected :

       

      • parry2k's avatar
        parry2k
        Super User

        Anonymous who you are referring too? if multiple people are replying, do refer/tag by their name otherwise not sure whose solution tried?