I am trying to fill missing values with 0 in a line chart in my PowerBI.
In my line chart, my x-axis is `Table[month]' and my y-axis is 'Count of 'Table[id]' and it has legend 'Table[level]'
Table
| month | id | level |
|---|---|---|
| jan | 1 | 1 |
| jan | 3 | 2 |
| feb | 4 | 2 |
e.g. So I want 0 for Feb level 1 in the line chart, since it has no value in ^ data.
So I read this post https://community.powerbi.com/t5/DAX-Commands-and-Tips/Fill-in-missing-values-in-a-line-graph-with-0-while-respecting/m-p/2193331, and a measure
Measure = var _1= COUNT(Table[id]) +0
var _min = minx(ALLSELECTED(Table), Table[month])
var _max = maxx(ALLSELECTED(Table), Table[month])
return
CALCULATE(if(max(Table[month]) <_min || min(Table[month]) >_max , 0, _1))
But it does not solve anything because I think max(Table[month]) <_min || min(Table[month]) >_max is always false and the measure is always _1
I also tried create a different measure
Measure 2 = CALCULATE(if(ISBLANK(Table[month]), 0, COUNT(Table[Id])))
But I get error saying `A single value for column month in Table Table cannot be determined. This can happen when a measure formula refers to a column that contains many values'
Can you please help me with this issue? Thank you.






