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

Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now

Reply
chinaik123
Helper II
Helper II

Not able to show other months once filter data with no months

Hi, 

 

I am having troubles to show in a chart those months that has no values.

I read from somewhere this in forum that to [Show Values with No data] but it is still not appearing.

chinaik123_0-1715830166490.png

Please help me as it looks like a very wrong representation of a chart.

 

1 ACCEPTED SOLUTION

Hi,

Thanks for the solutions @Ashish_Mathur  and @danextian  provided, and i want to offer some more information for user to refer to.

hello @chinaik123 , based on your description, you want to sort the month by fiscal month, you can refer to the following solution.

Create a calendar table.

Calendar =
ADDCOLUMNS (
    CALENDAR ( DATE ( 2022, 1, 1 ), DATE ( 2023, 12, 31 ) ),
    "Year", YEAR ( [Date] ),
    "Month", FORMAT ( [Date], "MMMM" ),
    "MonthNo", MONTH ( [Date] ),
    "Quarter", QUARTER ( [Date] ),
    "FY", YEAR ( EDATE ( [Date], -3 ) )
)

Then add a rank column in calendar table

Rank =
VAR a =
    SUMMARIZE ( 'Calendar', [MonthNo] )
VAR b =
    ADDCOLUMNS (
        a,
        "Flag",
            SWITCH (
                [MonthNo],
                1, 10,
                2, 11,
                3, 12,
                RANKX ( FILTER ( a, [MonthNo] >= 4 ), [MonthNo],, ASC )
            )
    )
RETURN
    MAXX ( FILTER ( b, [MonthNo] = EARLIER ( [MonthNo] ) ), [Flag] )

Then select the Month column and select sort by Rank column

vxinruzhumsft_0-1716274153036.png

 

2.Create a relationship between the data table and calendar table.

vxinruzhumsft_1-1716274193062.png

 

3.In calendar table, create a new hierachy based on the fiscal year.

vxinruzhumsft_2-1716274238800.png

Then put this hierachy to the x-axis.

vxinruzhumsft_3-1716274275664.png

 

Output

vxinruzhumsft_5-1716274708217.png

 

Best Regards!

Yolo Zhu

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
danextian
Super User
Super User

Hi @chinaik123 ,

Show items with blank values applies only to rows that exist in your table. For example, if your table has a month column but there isn't a row for January, that missing row will not magically appear in your visual. A row with blank value is different from a row that doesn't exist.  That said, use a separate dates table and use the month from that table in your visual. You can use CALENDAR function to do that. Sample calculated table:

Dates =
VAR __BASE =
    CALENDAR ( DATE ( 2024, 1, 1 ), DATE ( 2024, 12, 31 ) ) --replace the second date with today if you want the dates to be until today
RETURN
    ADDCOLUMNS (
        __BASE,
        "Year", YEAR ( [Date] ),
        "Month", FORMAT ( [Date], "mmmm" ),
        "Month Sort", MONTH ( [Date] ),
        --use this to sort Month by
        "Month and Year", FORMAT ( [Date], "mmm-yy" ),
        "Month and Year Sort", FORMAT ( [Date], "YYYYMM" ) -- use this to sort Month and Year by
    )

Make sure to create a relationship between this dates table and your fact table.

You may create another measure by appending +0 to your existing measure  (eg new measure = [old measure] + 0) in the visual so it shows zero instead of blank when the value is blank. By default, Power BI hides rows with blank values. There'd be no need to show items wi th blank values if you use this method.

 










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


Proud to be a Super User!









"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Hi @danextian 
Thank you it seems to be working , however, can i sort by Fiscal Month instead? 
Meaning that the Month starts from April instead of Jan.

 

Thanks in advance.

Hi,

Thanks for the solutions @Ashish_Mathur  and @danextian  provided, and i want to offer some more information for user to refer to.

hello @chinaik123 , based on your description, you want to sort the month by fiscal month, you can refer to the following solution.

Create a calendar table.

Calendar =
ADDCOLUMNS (
    CALENDAR ( DATE ( 2022, 1, 1 ), DATE ( 2023, 12, 31 ) ),
    "Year", YEAR ( [Date] ),
    "Month", FORMAT ( [Date], "MMMM" ),
    "MonthNo", MONTH ( [Date] ),
    "Quarter", QUARTER ( [Date] ),
    "FY", YEAR ( EDATE ( [Date], -3 ) )
)

Then add a rank column in calendar table

Rank =
VAR a =
    SUMMARIZE ( 'Calendar', [MonthNo] )
VAR b =
    ADDCOLUMNS (
        a,
        "Flag",
            SWITCH (
                [MonthNo],
                1, 10,
                2, 11,
                3, 12,
                RANKX ( FILTER ( a, [MonthNo] >= 4 ), [MonthNo],, ASC )
            )
    )
RETURN
    MAXX ( FILTER ( b, [MonthNo] = EARLIER ( [MonthNo] ) ), [Flag] )

Then select the Month column and select sort by Rank column

vxinruzhumsft_0-1716274153036.png

 

2.Create a relationship between the data table and calendar table.

vxinruzhumsft_1-1716274193062.png

 

3.In calendar table, create a new hierachy based on the fiscal year.

vxinruzhumsft_2-1716274238800.png

Then put this hierachy to the x-axis.

vxinruzhumsft_3-1716274275664.png

 

Output

vxinruzhumsft_5-1716274708217.png

 

Best Regards!

Yolo Zhu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

Ashish_Mathur
Super User
Super User

Hi,

Drag this measure to your visual

Measure = coalesce([your measure],0)

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Share the download link of the PBI file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hi 
I am also not able to get it after using the measure.

 

Helpful resources

Announcements
OCT PBI Update Carousel

Power BI Monthly Update - October 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

October NL Carousel

Fabric Community Update - October 2024

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