Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Anonymous
Not applicable

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:

 

1 consulta.JPG2 consulta.JPG

 

 

 

 

1 ACCEPTED SOLUTION
v-frfei-msft
Community Support
Community 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)'))

Capture.PNG

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

View solution in original post

1 REPLY 1
v-frfei-msft
Community Support
Community 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)'))

Capture.PNG

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.