Forum Discussion

SiobhanWendy's avatar
SiobhanWendy
Regular Visitor
2 years ago

comparing unfiltered data to filtered data

HI

 

I am fairly new to Power Bi so may just need to be pushed in right direction re functions.

 

I am doing profiling of estates by the EDI strands of the people living on the estates.  I want to be able to filter either the page or whole report by a specific estate and be able to see how this filtered group compares to the overall population. I can see I can edit interactions and maybe have two tables for ethnic breakdown, e.g. one overall and one according to the filer applied but I'd prefer to have a single table like below. Any ideas what I should be doing to achieve this?

 

GroupOverall populationSelected estate
Arab5%10%
Asian10%30%

Black

20%10%

White

55%30%

Other

10%20%

 

4 Replies

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

    SiobhanWendy Need sample data to be specific. But to do what you want, you can do something like this:

    Selected Estate =
      VAR __Count = COUNTROWS('Table')
      VAR __CountSelected = COUNTROWS(ALLSELECTED('Table'))
      VAR __Result = DIVIDE( __Count, __CountSelected )
    RETURN
      __Result
    
    Overall Population =
      VAR __Count = COUNTROWS('Table')
      VAR __CountAll = COUNTROWS(ALL('Table'))
      VAR __Result = DIVIDE( __Count, __CountAll )
    RETURN
      __Result
  • Greg_Deckler  Tested and not quite. I think this is on the right track but not quite in right way. This loses the overall population % breakdown (which I want to remain fixed) and instead the table shows 1 column showing what % of overall pop the selected filter is, and column 2 showing the breakdown for that estate.

  • So if my overall population is 45% white, I want it to remain at 45% for the 'overall' column regardless of applied filters, but I want the second column to show what % of the filtered population (e.g. by estate) is white.