Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Clicking on Visual not filtering all fields

 I am new to Power BI and not sure what I need to be looking for.  I have a bar graph visual with certain values by region.  When I click on the region it should filter my second visual, which has 3 totals; sum of all, sum of nurses and sum of doctors.  It only filters the sum of all, the sum of nurses and doctors never changes no matter what region I click.  Why would it do this?  What do I need to check, look for?

  • HI  Anonymous 

     It only filters the sum of all, the sum of nurses and doctors never changes no matter what region I click.  

    It means that for sum of nurses and sum fo doctors there must be ALL function in the formula

    for example:

    sum of doctor = CALCULATE(SUM('Table'[value]),FILTER(ALL('Table'),'Table'[Position]="Doctor"))
    sum of doctor 2 = CALCULATE(SUM('Table'[value]),FILTER('Table','Table'[Position]="Doctor"))
     
    your measure should like sum of doctor, please  try the formula  as sum of doctor 2.

    https://www.sqlbi.com/articles/managing-all-functions-in-dax-all-allselected-allnoblankrow-allexcept/

     

    If you still have the problem, please share your sample pbix file for us have a test, that will be a great help.

     

    Regards,

    Lin

3 Replies

  • az38's avatar
    az38
    Icon for Community Champion rankCommunity Champion

    Anonymous 

    smth like

    Sum of Doctors = CALCULATE(COUNTROW(Table), Table[Position] = "Doctor")
    
    Sum of Nurses = CALCULATE(COUNTROW(Table), Table[Position] = "Nurse")
  • v-lili6-msft's avatar
    v-lili6-msft
    Icon for Community Support rankCommunity Support

    HI  Anonymous 

     It only filters the sum of all, the sum of nurses and doctors never changes no matter what region I click.  

    It means that for sum of nurses and sum fo doctors there must be ALL function in the formula

    for example:

    sum of doctor = CALCULATE(SUM('Table'[value]),FILTER(ALL('Table'),'Table'[Position]="Doctor"))
    sum of doctor 2 = CALCULATE(SUM('Table'[value]),FILTER('Table','Table'[Position]="Doctor"))
     
    your measure should like sum of doctor, please  try the formula  as sum of doctor 2.

    https://www.sqlbi.com/articles/managing-all-functions-in-dax-all-allselected-allnoblankrow-allexcept/

     

    If you still have the problem, please share your sample pbix file for us have a test, that will be a great help.

     

    Regards,

    Lin