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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Surendra_thota
Helper II
Helper II

How to add Missing rows and add zero % for missing rows

Hi All

 

we are gettig data from the table for every month , if  some month is missing we need add row . for example 

Reading towards complaince / Monthly Frequency Target = complaince%   ( >100%  is equal to 100%)

for missing rows we need to consider   0/1 = 0 %  ,   we need to aggregate fro year with 0 percentage  for missing rows. how to achieve that 

 

Missing Rows.PNG

1 ACCEPTED SOLUTION
v-jiascu-msft
Microsoft Employee
Microsoft Employee

Hi @Surendra_thota,

 

These missing months don't exist, so let's create them. (Modeling -> New Table -> input this formula)

Date =
DISTINCT (
    SELECTCOLUMNS (
        CALENDAR ( DATE ( 2016, 1, 1 ), DATE ( 2017, 12, 31 ) ),
        "Month1", EOMONTH ( [Date], 0 )
    )
)

Create a relationship from "Month1" to "month";

Then join the two tables together.

Table 2 =
NATURALLEFTOUTERJOIN ( 'Date', 'Table1' )

 

 

How to add Missing rows and add zero % for missing rows.jpg 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Best Regards!

Dale

 

Community Support Team _ Dale
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

7 REPLIES 7
v-jiascu-msft
Microsoft Employee
Microsoft Employee

Hi @Surendra_thota,

 

Could you please mark the proper answer if it's convenient for you? That will be a help to others.

 

Best Regards!
Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
v-jiascu-msft
Microsoft Employee
Microsoft Employee

Hi @Surendra_thota,

 

These missing months don't exist, so let's create them. (Modeling -> New Table -> input this formula)

Date =
DISTINCT (
    SELECTCOLUMNS (
        CALENDAR ( DATE ( 2016, 1, 1 ), DATE ( 2017, 12, 31 ) ),
        "Month1", EOMONTH ( [Date], 0 )
    )
)

Create a relationship from "Month1" to "month";

Then join the two tables together.

Table 2 =
NATURALLEFTOUTERJOIN ( 'Date', 'Table1' )

 

 

How to add Missing rows and add zero % for missing rows.jpg 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Best Regards!

Dale

 

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

I have a similar issue wherein I have to add missing seconds row as zero. What changes should be made to the DAX code.

dilumd
Impactful Individual
Impactful Individual

Hi

 

You can do this in query editor (right click on the relevant column) and replace "null" with "0" as shown below.

 

try.JPG

Hope this helps

 

 

It is a measure ,it's not a column

Then you can right the measure with IF function which will return 0 if your logic is not true.

That is not working as there is no row in database, if you my screen shot there are no records for Jan , Feb , March etc but we need to values reading for compliance =0 and monthly frequency target =1 and complaice =0% for those missing rows

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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