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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
vnqt
Helper IV
Helper IV

Histogram based on a filter

Hi, 

 

 I would like to create a histogram as below : 

vnqt_1-1662635279353.png

 

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.

 

1 ACCEPTED SOLUTION
PowerUserR
Solution Supplier
Solution Supplier

Hi,

You could create a new column like this: 

PowerUserR_0-1662637163868.png


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: 

PowerUserR_1-1662637336624.png

 



I hope that helps 🙂 

View solution in original post

4 REPLIES 4
PowerUserR
Solution Supplier
Solution Supplier

Hi,

You could create a new column like this: 

PowerUserR_0-1662637163868.png


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: 

PowerUserR_1-1662637336624.png

 



I hope that helps 🙂 

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. 

vnqt_0-1662644173726.png

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

 

 

 

I am not sure what you are trying to do with the null values.

Would you want to use something like this? https://docs.microsoft.com/en-us/dax/lookupvalue-function-dax

Does the other table's sub group have null values as well?

Thank you for the info. I would try this. 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.