Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Histogram based on a filter

Hi, 

 

 I would like to create a histogram as below : 

 

Here are the data

Name GroupSub-group 
A1234W123AAA
B1234w123AAA
C1234w456AAA
D1234w456AAA
D1234w789AAA
D1234w789AAA
D1234w456AAA
E1236w789AAA
E1238w456AAA
A1236w789BBB
A1237w123BBB
D1237w456BBB
D1235w456BBB
E1237w789BBB
E1239w456BBB
B1236w789CCC
B1237w123CCC
E1234w789CCC
E1235w123CCC
A1235w123DDD
B1235w456EEE
C1235w456FFF
C1237w123III
C1236w789UUU


Could you please advise how I could exclude the Name where the Sub-group has only 1 Name: 

For example :  the following Name should be removed from the histogram

Name GroupSub-group 
A1235w123DDD
B1235w456EEE
C1235w456FFF
C1237w123III
C1236w789UUU

 

Thank you in advance.

 

  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi,

    You could create a new column like this: 


    And then use that new column as a filter for the visual and exclude when value is less than 2. Or inlude only those that are greater than 1: 

     



    I hope that helps 🙂 

4 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi,

    You could create a new column like this: 


    And then use that new column as a filter for the visual and exclude when value is less than 2. Or inlude only those that are greater than 1: 

     



    I hope that helps 🙂 

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thank you. 

      Here is the DAX I use : 

      = Calculate(DISTINCTCOUNT(Table[Name]), FILTER(Table, EARLIER(Table[Subgroup]) = Table[Subgroup]))

      However, I find out that there are many "null" values in the column Sub-group. 

      How could I compare the sub-group column which is in another table that has relation to this table?

      I do something similar for the Matrix , then filter the value > 1. 

      But for the histogram, I can't do this filter.