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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

Show x-axis values when no y-axis value is available

I have a data set similar to the one below. I would like to show date in the x-axis and event1 in the y-axis. As you see, there is not a event1 value for each date value, but I would like to see them all, event if no data is available. See screenshots below for clarification. 

 
I need to do this when the variable in the x-axis is both categorical and continuous. Can you please provide solutions for both? 
 
Thanks a lot
 
Untitled2.pngUntitled.png
1 ACCEPTED SOLUTION
AnthonyTilley
Solution Sage
Solution Sage

create a new measure and use an if statment to replace blanks with zeros

 

Event1Line = 
var ev1 = sum('Table'[Event1])
var ret = if(ev1 = BLANK(),0,ev1)
return ret

top line is using just to event1 colunm the second is a new line using the measure above

 

lines.png





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

1 REPLY 1
AnthonyTilley
Solution Sage
Solution Sage

create a new measure and use an if statment to replace blanks with zeros

 

Event1Line = 
var ev1 = sum('Table'[Event1])
var ret = if(ev1 = BLANK(),0,ev1)
return ret

top line is using just to event1 colunm the second is a new line using the measure above

 

lines.png





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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