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

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.

Reply
ajames95
Frequent Visitor

How to include null values in filter visualization?

Hi, 

 

I have a simple graph that i am filtering with a date slicer. 

However I want the null values to show when i click on certain dates? 

 

This is when I there is no filtering on the graph. 

 

Capture.PNG

When I select a specific month, I want all the type of category on the x axis, even if theres no data to show this. 

Capture1.PNG

Is there a way we can do this on Power BI?

1 ACCEPTED SOLUTION
v-juanli-msft
Community Support
Community Support

Hi @ajames95 

Leave main data table and calendar table no relationship

Capture9.JPG

Create a measure

Measure =
VAR slectedmo =
    SELECTEDVALUE ( 'calendar'[year-month] )
VAR y_m =
    FORMAT ( MAX ( 'Table'[date] ), "yyyy-mm" )
RETURN
    CALCULATE ( SUM ( 'Table'[value] ), FILTER ( 'Table', slectedmo = y_m ) )

Capture8.JPG

 

Best Regards
Maggie

 

Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

6 REPLIES 6
v-juanli-msft
Community Support
Community Support

Hi @ajames95 

Leave main data table and calendar table no relationship

Capture9.JPG

Create a measure

Measure =
VAR slectedmo =
    SELECTEDVALUE ( 'calendar'[year-month] )
VAR y_m =
    FORMAT ( MAX ( 'Table'[date] ), "yyyy-mm" )
RETURN
    CALCULATE ( SUM ( 'Table'[value] ), FILTER ( 'Table', slectedmo = y_m ) )

Capture8.JPG

 

Best Regards
Maggie

 

Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi Maggie, 

 

I only have one table - 

 

1 Year/Month = FORMAT('Table'[Logged Date],"YYYY-MM")

Capture3.PNG

Hi @ajames95 

There is no direct way to slove your problem, so i provide a workaround.

Please create a calendar table:

New Table-> enter this formula

calendar = ADDCOLUMNS(CALENDARAUTO(),"year-month",FORMAT([Date],"yyyy-mm"))

Then follow my methods in the previous post.

 

Best Regards
Maggie

 

Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

jdbuchanan71
Super User
Super User

Hello @ajames95 

Under Axis on the category line pick the down arrow and select 'Show items with no data"

ShowItemsWithNoData.jpg

Hello @jdbuchanan71 

 

Thanks for that but it did not work.. 

 

 

Can you share your .pbix file? 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.