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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
sujaisparks
Advocate I
Advocate I

How to calculate percentage covered vs not covered

Please help me with this scenario at hand

 

I have a factless fact table imported into a Power BI Desktop model that contains the product modules with Testcase Groups and Testcases as shown in the example below:

 

Module  TestCaseGroup   TestCaseID   
AG1101
AG1102
AG2101
AG2102
AG2103
AG2104
AG3102
AG3105
BG4201
BG4203
BG5201
BG5202
BG5203

 

What I need to calculate and show in Power BI Desktop is two things:

  1. When I select a Module (in slicer) and a Testcase Group (in slicer), how can I calculate the count or percentage of Testcases not covered by the Testcase Group for the selected module.  For example, if I select module A in the above table, there are total 5 distinct testcases. Within that module, if I select Testcase Group G1, the count of testcases covered is 2 and count of test cases not covered is 3. Similarly if I select G2, it is 4 vs 1.
  2.  Also if possible, how to show the list of distinct testcaseids that are not covered by the selected Testcase Group for the selected module

 

Please kindly help.

3 ACCEPTED SOLUTIONS
Zubair_Muhammad
Community Champion
Community Champion

HI @sujaisparks

 

Try these MEASURES

 

Test_Cases_Covered =
DISTINCTCOUNT ( TableName[TestCaseID] )
Test_Cases_Not_Covered =
CALCULATE (
    DISTINCTCOUNT ( TableName[TestCaseID] ),
    ALL ( TableName[TestCaseGroup] )
)
    - [Test_Cases_Covered]

View solution in original post

@sujaisparks

 

To get the Names of IDs not covered, you can use this MEASURE

 

IDs not covered =
CONCATENATEX (
    EXCEPT (
        CALCULATETABLE (
            VALUES ( TableName[TestCaseID] ),
            ALL ( TableName[TestCaseGroup] )
        ),
        VALUES ( TableName[TestCaseID] )
    ),
    [TestCaseID],
    ", "
)

View solution in original post

5 REPLIES 5
Zubair_Muhammad
Community Champion
Community Champion

HI @sujaisparks

 

Try these MEASURES

 

Test_Cases_Covered =
DISTINCTCOUNT ( TableName[TestCaseID] )
Test_Cases_Not_Covered =
CALCULATE (
    DISTINCTCOUNT ( TableName[TestCaseID] ),
    ALL ( TableName[TestCaseGroup] )
)
    - [Test_Cases_Covered]

Tons of thanks to you sir for the help!!

What changes do I have to do the measure (Test_cases_not_covered) if need to put the TestcaseGroup Dimension attribute (TestcaseGroupDescription) as a slicer. This is a snapshot of the relationship with the factless fact table.

 

Relationship Diagram.png

 

Here is the copy of the poc i'm working on My POC

Tons of thanks to you sir for the help!!

What changes do I have to do the measure (Test_cases_not_covered) if need to put the TestcaseGroup Dimension attribute (TestcaseGroupDescription) as a slicer. This is a snapshot of the relationship with the factless fact table.

 

Relationship Diagram.png

 

Here is the copy of the poc i'm working on My POC

@sujaisparks

 

To get the Names of IDs not covered, you can use this MEASURE

 

IDs not covered =
CONCATENATEX (
    EXCEPT (
        CALCULATETABLE (
            VALUES ( TableName[TestCaseID] ),
            ALL ( TableName[TestCaseGroup] )
        ),
        VALUES ( TableName[TestCaseID] )
    ),
    [TestCaseID],
    ", "
)

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.