Forum Discussion

mahitham's avatar
mahitham
Helper I
7 years ago
Solved

Measure syntax help

Hi,

 

Can any one please help me to write the expression like

 

Sum(visits) where Media Type = "PAID MEDIA"

 

In Media Type i have PAID MEDIA and SOCIAL MEDIA. In the above expression i have to show only PAID MEDIA visits.

 

I have tried like below but getting error. Please help me on this.

Thanks in advance

 

 

  • mahitham

     

    Try like this for your filter

     


    FILTER (
       ALL ( 'Digital Marketing'[Media Type] ),
      'Digital Marketing'[Media Type] = "PAID MEDIA"
     )

  • Hello, mahitham

    Correct formula below

    Paid Media Visits =
    CALCULATE (
        [Total Visits],
        FILTER ( 'Digital Marketing', 'Digital Marketing'[Media Type] = "PAID MEDIA" )
    )

2 Replies

  • mahitham

     

    Try like this for your filter

     


    FILTER (
       ALL ( 'Digital Marketing'[Media Type] ),
      'Digital Marketing'[Media Type] = "PAID MEDIA"
     )

  • popov's avatar
    popov
    Resolver III

    Hello, mahitham

    Correct formula below

    Paid Media Visits =
    CALCULATE (
        [Total Visits],
        FILTER ( 'Digital Marketing', 'Digital Marketing'[Media Type] = "PAID MEDIA" )
    )