Forum Discussion
Aho00
9 months agoRegular Visitor
Chart without data
Hello, I need some help I would like to count the rows from my data table and show them in a chart. And I want it to display 0 when there is no data for the one no showing up in my data table. My da...
- 9 months ago
Hi Aho00
Adding 0 forces DAX to add 0 even for the rows that are not supposed to be there or within the slicer selection. Add a condition do your measure that checks whether a specific date is within the selected range
VAR _start = MINX ( ALLSELECTED ( CalendarTable ), CalendarTable[date] ) VAR _end = MAXX ( ALLSELECTED ( CalendarTable ), CalendarTable[date] ) RETURN IF ( SELECTEDVALUE ( CalendarTable[date] ) >= _start && SELECTEDVALUE ( CalendarTable[date] ) <= _end, [your measure] + 0 )
danextian
Super User
9 months agoHi Aho00
Adding 0 forces DAX to add 0 even for the rows that are not supposed to be there or within the slicer selection. Add a condition do your measure that checks whether a specific date is within the selected range
VAR _start =
MINX ( ALLSELECTED ( CalendarTable ), CalendarTable[date] )
VAR _end =
MAXX ( ALLSELECTED ( CalendarTable ), CalendarTable[date] )
RETURN
IF (
SELECTEDVALUE ( CalendarTable[date] ) >= _start
&& SELECTEDVALUE ( CalendarTable[date] ) <= _end,
[your measure] + 0
)
- Aho009 months agoRegular Visitor
Hello,
Thanks for the answer, it works great!
Have a nice day.