Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago

In Context operator equivalent in Power BI

Hi,

 

I have created a formula in Business Objects which i want to replicate in DAX power bi but not sure how to do this. Can anyone offer some help/advice on how i can do this.

 

The formula in Business objects is:

=Count([SSA ASC - Step ID])In([First Contact].[Person Details - Person ID];[SSA First Contact - Workflow ID])Where([SSA ASC - Step Status]="COMPLETED") + Count([SSA ASC Follow Up - Step ID])In([First Contact].[Person Details - Person ID];[SSA First Contact - Workflow ID])Where([SSA ASC Follow Up - Step Status]="COMPLETED")

 

kind regards

Hetal

3 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi lbendlin

     

    I am not sure how to attach a sample file. 

     

    I want to replicate the above measure used in Business Objects into power bi. I have tried to split the above into 2 separate measures:

    first measure = CALCULATE(DISTINCTCOUNTNOBLANK('First Contact'[Advice & Support KI_STEP_ID]),'First Contact'[Advice & Support STEP_STATUS]="COMPLETED")

     

    second measure = CALCULATE(DISTINCTCOUNTNOBLANK('First Contact'[Followup KI_STEP_ID]),'First Contact'[Followup STEP_STATUS]="COMPLETED")
     
    I now need to add the 2 measures so measure created as: total measure = first measure + second measure
    Up to this point i works. However i now need to create 3 measures:
    Total Measure is 1 = CALCULATE(DISTINCTCOUNTNOBLANK('First Contact'[First Contact WORKFLOW_ID]),FILTER('First Contact',[Measure 3]=1))
    Total measure is 2 = CALCULATE(DISTINCTCOUNTNOBLANK('First Contact'[First Contact WORKFLOW_ID]),FILTER('First Contact',[Measure 3]=2))
    Total measure is 3 or more = CALCULATE(DISTINCTCOUNTNOBLANK('First Contact'[First Contact WORKFLOW_ID]),FILTER('First Contact',[Measure 3]>=3))
     
    This gives me the below result:
     
    MonthNov
    Total Measure is 175
    Total Measure is 29
    Total Measure is 3 or more 
     
     I am expecting this result:
     
     Nov
    Total Measure is 173
    Total Measure is 24
    Total Measure is 3 or more5

     

    For some reason, the maximum count is 2 which is wrong.