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.
Hi ,
I am creating a visual that required me to show all of the categories even that categories has no "Count".
I tried the "Show item with no data" but it is still not working as I would like it to.
Data:
I have a column of "school ID"
A column of "category" of the score
A column of "Legislative ID"
Visual:
y-axis : The count of the schools in certain category
x-axis: The categories available. (I want to list all 5 categories)
Page Level filter:
Legislative ID
What I have now:
When I made a selection of Legislative ID. The bar chart only show the categories that certain district has. Sometimes it is two, three or four.
Desired outcome:
When I make a selection of Legislative ID. I would like the Bar Chart to show the Count of schools in the district selected AND Still "show all of the x-axis Categories" even though that Legislative district does not have school falls in that category.
Solved! Go to Solution.
Hi @LilianTan,
I made one sample for your reference. Please check the following steps as below.
1. Create a calculated table and create the relationship between it and the fact table, please make the relationship inactive.
Table = VALUES(data[category])
2. Create a measure as below. Then we can get the result as we excepted.
Measure = var countsc = CALCULATE(COUNT(data[school ID]),USERELATIONSHIP(data[category],'Table'[category])) return IF(ISBLANK(countsc),0,countsc)
For more details, please check the pbix as attached.
Regards,
Frank
Hi @LilianTan,
I made one sample for your reference. Please check the following steps as below.
1. Create a calculated table and create the relationship between it and the fact table, please make the relationship inactive.
Table = VALUES(data[category])
2. Create a measure as below. Then we can get the result as we excepted.
Measure = var countsc = CALCULATE(COUNT(data[school ID]),USERELATIONSHIP(data[category],'Table'[category])) return IF(ISBLANK(countsc),0,countsc)
For more details, please check the pbix as attached.
Regards,
Frank
Thank you so much for the help.
I really learned something useful from your post.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
114 | |
99 | |
83 | |
70 | |
60 |
User | Count |
---|---|
150 | |
115 | |
104 | |
89 | |
65 |