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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

Help me to understand Dax results

Hello ,

 

I'm trying to use  Dax expressions to count how many people are eligible to a bonus or not .

 

My Data set is the following

 

Hologanpa_0-1602666945182.png

 

I have a fact table (Data) wich is related with a matching table (Correspondance Nom)   , wich is related with an other table (Tech) allowing me to display only the people I need ( may be adding a column to my fact table , stating " Active" or "not Active would be a better option ? )

 

Here are results I don't understand when I try  simple dax formulas :

 

 - Measure = count ( tech [ Technician] )  ,  =>  not affected by my bonus filter ( Yes / NO , from Data ) 

I tried this one first , thinking that I will count only filtered  active people ..

 

 - Measure = count ( Data [ Technician] )  ,  =>  This one is affected by my filter and works properly , but  tbh I expected that it count all technicians, even those who aren't in the Tech table 

 

- Measure = Calculate (count ( Data [ Technician] ) , All (Data [ Bonus ] ) ) => Keep being filtered by the Bonus filter even if I use "ALL" statement ... 

 

I reached my goal by simply doing   

Mesure = count ( Data [ Technician] )  /  count ( tech [ Technician] 

 

 but I don't like when I don't understand .. 

 

Any help much appreciated ! 

 

 

TIA  😊

1 REPLY 1
dedelman_clng
Community Champion
Community Champion

Hi @Anonymous 

 

count ( tech [ Technician] )

 

Tech will not be filtered by Data since you don't have filter propogation going from Data to Correspondence. If you make the filter relationship between Data and Correspondence bi-directional, you should be able to filter Tech based on Data

 

count ( Data [ Technician] )

 

This measure doesn't take into account the relationship to Tech, unless you put a filter on Tech

 

Calculate (count ( Data [ Technician] ) , All (Data [ Bonus ] ) )

 

I can't reproduce this issue off hand.

2020-10-15 07_47_35-scratch4 - Power BI Desktop.png2020-10-15 07_47_58-scratch4 - Power BI Desktop.png

 

There may be something else in your model or in the way you are implementing the bonus filter that is causing issues.

 

 

Hope this helps

David

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors