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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
Premlatapandey9
Microsoft Employee
Microsoft Employee

How to calculate % based on row count from 2 tables

Hello Users,

 

I have a large matrix set up and would like to set up a measure that calculates the total row percentage. ie:

 

I am taking 2 columns from 2 tables in calculation i.e-

 

 Table 1 Coulmn 1 Null IDTable 2 Coulmn 2 Not Null ID 
 11 
 22 
 33 
 44 
 55 
Total count 56 
  7 
  8 
  9 
  10 
 Total Count10 
 Total Count Null + Not Null15 
 Null%0.333333333Total Null/Total Null+Not Null
 Not Null % 0.666666667Not Null/Total Null+Not Null
    
    
    

 

 

@members please help 

Thanks!

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

Hi @

 

You may try this solution.

1 Create a Calculated Table

Table = SELECTCOLUMNS( {"Total Count Null + Not Null","Null%","Not Null %"},"details",[Value])

 

2 Create a Measure

Count&Percent =
VAR numTable1 =
    COUNTROWS ( 'Table 1' )
VAR numTable2 =
    COUNTROWS ( 'Table 2' )
RETURN
    SWITCH (
        MAX ( 'Table'[details] ),
        "Total Count Null + Not Null", numTable1 + numTable2,
        "Null%",
            numTable1 / ( numTable1 + numTable2 ),
        "Not Null %",
            numTable2 / ( numTable1 + numTable2 )
    )

 

Then, build a Table visual like this.

vcazhengmsft_0-1663296224951.png

 

Also, attached the pbix file as reference.

 

If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please let me know. Thanks a lot!

 

Best Regards,    

Community Support Team _ Caiyun

View solution in original post

3 REPLIES 3
Premlatapandey9
Microsoft Employee
Microsoft Employee

Hello @member @v-cazheng-msft can you please help me how i will get the average of mandatory null and not null value from the above data in same dax query or separate?

Premlatapandey9
Microsoft Employee
Microsoft Employee

@v-cazheng-msft Thank you so much for this help! It worked !!!!

v-cazheng-msft
Community Support
Community Support

Hi @

 

You may try this solution.

1 Create a Calculated Table

Table = SELECTCOLUMNS( {"Total Count Null + Not Null","Null%","Not Null %"},"details",[Value])

 

2 Create a Measure

Count&Percent =
VAR numTable1 =
    COUNTROWS ( 'Table 1' )
VAR numTable2 =
    COUNTROWS ( 'Table 2' )
RETURN
    SWITCH (
        MAX ( 'Table'[details] ),
        "Total Count Null + Not Null", numTable1 + numTable2,
        "Null%",
            numTable1 / ( numTable1 + numTable2 ),
        "Not Null %",
            numTable2 / ( numTable1 + numTable2 )
    )

 

Then, build a Table visual like this.

vcazhengmsft_0-1663296224951.png

 

Also, attached the pbix file as reference.

 

If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please let me know. Thanks a lot!

 

Best Regards,    

Community Support Team _ Caiyun

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.