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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
vnqt
Helper V
Helper V

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
Anonymous
Not applicable

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
Anonymous
Not applicable

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. 

 

 

 

Anonymous
Not applicable

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
Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.