Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago

Update Measure to interact in visual. ALL? ALLSELECTED?

Hi,

 

I've created two measures that I would like to slightly alter [CA] and [CCOPD].  I would like to alter these two measures so they can interact with a table visual I've created.  By "interact" I mean...when I click on a slice of the pie graph I would like the [Count of MBR_ID] values to change accordingly in the table visual.  The way these measures are currently written does not allow them to update the table.

 

Here is a picture of my two visuals (the pie visual and table visual):

 

Here are the two measures that I would like to update:

 

CA = DIVIDE(CALCULATE(DISTINCTCOUNT('Data Files'[MBR_ID]), FILTER(ALLSELECTED('Data Files'), 'Data Files'[ASTHMA_IND] = "Asthma")), DISTINCTCOUNT('Data Files'[MBR_ID]))
 
CCOPD = DIVIDE(CALCULATE(DISTINCTCOUNT('Data Files'[MBR_ID]), FILTER(ALLSELECTED('Data Files'), 'Data Files'[COPD_IND] = "Chronic Obstructive Pulmonary Disease")), DISTINCTCOUNT('Data Files'[MBR_ID]))

 

I'm not sure if I should be using the ALLSELECTED here.  I've tried using ALL instead of the ALLSELECTED in its place but that did not work either.

 

Can you please help me alter these two measures so they can interact as I've laid out above?

 

 

 

Thank you,

Andrew

 

2 Replies

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

    Anonymous Sorry, having trouble following, can you post sample data as text and expected output?


    Not really enough information to go on, please first check if your issue is a common issue listed here: https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882

    Also, please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

    The most important parts are:
    1. Sample data as text, use the table tool in the editing bar
    2. Expected output from sample data
    3. Explanation in words of how to get from 1. to 2.

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

    Hi Anonymous ,

     

    Based on my test. You can't interact between visuals when you fix the filter in dax formula like : 'Data Files'[ASTHMA_IND] = "Asthma" or  'Data Files'[COPD_IND] = "Chronic Obstructive Pulmonary Disease".  Since they are fixed in the formula, so the filters will not pass in visuals.

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

     

    Best Regards,

    Dedmon Dai