Forum Discussion

Creative_tree88's avatar
4 years ago
Solved

Measure to isolate specific field

Hi all - new to this!  have been using Qlikview for years and now we are transferring over to PowerBI so need to brush up on syntax used for certain measures.

 

I use the measure = DISTINCTCOUNT('Test Python Exam'[AD_Event_Key]) to calculate the count of clients but there are two elements to this count - Activity and Demand.  if I just use the above measure, it counts everything and what I need is to show tables with separated out counts for Activity and separate counts for Demand as this is how we measure everything!  A total count actually doesn't make any sense at all for us.

 

My Qlikview set analysis would look like this:

 

=count({<Activity_or_Demand={'Activity'},Financial_Year-={'2099'},Room-={'CTSIM','CTSIM2'},Individual_Exam_Parts_Per_Event-={'CLDTH'}>}Event_Key)

 

The above is exactly what I need, but in Power BI talk!  Anyone able to shed some light?  Once this is cracked, it's out bread and butter for measuring everything really.

 

many thanks peeps!

29 Replies

  • richbenmintz's avatar
    richbenmintz
    Resident Rockstar

    Hi Creative_tree88 ,

     

    I think the following measures  will provide a starting point.

    Activity Count = CALCULATE(DISTINCTCOUNT('Test Python Exam'[AD_Event_Key]), 'Test Python Exam' = "Activity")
    
    Demand Count = CALCULATE(DISTINCTCOUNT('Test Python Exam'[AD_Event_Key]), 'Test Python Exam' = "Demand")

    Hope this helps,

    • Creative_tree88's avatar
      Creative_tree88
      Helper V

      richbenmintz

       

      Thanks so much!  Presume the rest of the statement i.e

       

      =count({<Activity_or_Demand={'Activity'},Financial_Year-={'2099'},Room-={'CTSIM','CTSIM2'},Individual_Exam_Parts_Per_Event-={'CLDTH'}>}Event_Key)

       

      is done in the same way.  In Qlikview, to exclude a value it is written -= but I'm guessing PowerBi is different?  Having been so used to Qlikview lingo, it's just a case of getting the basics down, then I should be OK.  Appreciate the really quick reply, thanks v much!

      • richbenmintz's avatar
        richbenmintz
        Resident Rockstar

         

        Hi Creative_tree88 

         

        roughly translated,

        Activity Count = CALCULATE(DISTINCTCOUNT('Test Python Exam'[AD_Event_Key]), 'Test Python Exam' = "Activity", [Financial_Year]<>"2099",Individual_Exam_Parts_Per_Event<>"CLDTH", NOT (Room IN {"CTSIM","CTSIM2"}))