Forum Discussion
Show all items in X axis
Hi! Haven't found any simple solution here so just came up with my own.
My goal was pretty like author of the thread's but with hours in a day instead of weeks. So I calculated amount of incidents by hours of a day. And it was critical to save hours with zero-values for saving 24h structure of X-axis for user convinience. But filtering particular category gave me zero-value on some hours. And when I chose categorical X-axis it didn't show these hours with zeroes on viz so the 24h structure changed which made user feel acute pain.
SOLUTION I've found:
1) create mesuare in original table:
IncidentID_DistinctCount = DISTINCTCOUNT('TableOriginal'[IncidentID])
2) create new table:
Table1 = SUMMARIZECOLUMNS('TableOriginal'[Hour of incident])
It creates new Table1 with single column [Hour of incident], which contains all distinct values in the same column of original table. And since the creation it doesn't react on any filter context for original table.
3) create link between these two tables by columns [Hour of incident]
4) take column 'Table1'[Hour of incident] as X-axis
5) take measure IncidentID_DistinctCount from original table as values
Profit!