Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

HELP WITH DAX IGNORING TABLE RELATIONSHIP

SOME HELP PLEASE: (PBIX LINK): https://www.dropbox.com/s/ypxv1ift10e5v8q/BI%20VISITAS%20DEMO%20QUERY.pbix?dl=0

 

I have the following dax: 

MPP HC = CALCULATE(COUNTA('dotacion (3)'[ID. HR]);
'dotacion (3)'[PUESTO] IN {"VendedorEspecialistaenSeguridad";"VendedorExpertoenSeguridad"};
ALL('dotacion (3)'[ID. HR]))

 This DAX in my model counts in the column "ID.HR" BY 2 types of job positions out of 6 in the Column "PUESTO" and the idea is to count them and divide for "Demo quantity"  in 21 differents departments. ex:

Department 1 has 5 positions/ 5 DEMOS

Department 2 has 6 positions/30 DEMOS

Department 3 has 4 positions/ 45 DEMOS AND SO ON...

 

The desired result is to divide the DEMO Quantity of each department by the total of these 2 types of job positions as head counts. the problem is that for some reason is not dividing by the total of these 2 job positions they are less and I cant find the filter this model is applying. For example:

 

 

 

 

 

  • Hi Anonymous ,

     

    For the 1st question, To create a new measure as below.

     

    MPP HC2 = IF(SUM(PBI[Total]) = BLANK(),BLANK(),CALCULATE(COUNTA('dotacion (3)'[ID. HR]),ALL(PBI),'dotacion (3)'[PUESTO]IN {"VendedorEspecialistaenSeguridad","VendedorExpertoenSeguridad"}))

    For the 2rd one, to update your measure like this.

     

    MPP HC = CALCULATE(COUNTA('dotacion (3)'[ID. HR]),'dotacion (3)'[PUESTO] IN {"VendedorEspecialistaenSeguridad","VendedorExpertoenSeguridad"},ALL('dotacion (3)'))

     

1 Reply

  • v-frfei-msft's avatar
    v-frfei-msft
    Icon for Community Support rankCommunity Support

    Hi Anonymous ,

     

    For the 1st question, To create a new measure as below.

     

    MPP HC2 = IF(SUM(PBI[Total]) = BLANK(),BLANK(),CALCULATE(COUNTA('dotacion (3)'[ID. HR]),ALL(PBI),'dotacion (3)'[PUESTO]IN {"VendedorEspecialistaenSeguridad","VendedorExpertoenSeguridad"}))

    For the 2rd one, to update your measure like this.

     

    MPP HC = CALCULATE(COUNTA('dotacion (3)'[ID. HR]),'dotacion (3)'[PUESTO] IN {"VendedorEspecialistaenSeguridad","VendedorExpertoenSeguridad"},ALL('dotacion (3)'))