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
Anonymous
Not applicable

Fix wrong Total in a Matrix with Count function

Dear PBI community,

I would like to pose you a problem with a measure I'm currently using. 

 

The problem that I want to solve is counting the number of documents that are listed as revision "0" have completed a certain phase. The problem is that from time to time I have some missing information about this step but I have some information about the following one (Revision "A") which implies that the revision "0" has been done.

 

I managed to take into account this problem and to have the correct result with this measure:

 

 

Actual VDA received from PBR = 
var actual=
IF (
    SELECTEDVALUE(' Vendor Documents'[Revision])="A",
        CALCULATE(
            Count('Vendor Documents'[Revision]),
            filter(' Vendor Documents',' Vendor Documents'[Revision]="A")
        ),
    CALCULATE( 
        count(Workflows[Date Completed] ) ,
        Filter ( Workflows ,
        Workflows[Step] = "PBR Review" && Workflows[Document Revision]="0" )
    )
)

return actual

 

 

 However I have a wrong total count:

F_Cannata_1-1651062593876.png

I tried with SUMX and Summarize as others posts suggested, without particular success,

Do you have any idea on how I may solve this problem?

 

 

1 ACCEPTED SOLUTION
johnt75
Super User
Super User

Rename your existing measure as Individual Actual VDA received from PBR and then create a new measure

Actual VDA received from PBR = IF( ISINSCOPE('Table'[Document ID]), [Individual Actual VDA received from PBR],
var summaryTable =ADDCOLUMNS( SUMMARIZE( 'Table', 'Table'[Document ID]), "@val", [Individual Actual VDA received from PBR])
return SUMX( summaryTable, [@val])

View solution in original post

1 REPLY 1
johnt75
Super User
Super User

Rename your existing measure as Individual Actual VDA received from PBR and then create a new measure

Actual VDA received from PBR = IF( ISINSCOPE('Table'[Document ID]), [Individual Actual VDA received from PBR],
var summaryTable =ADDCOLUMNS( SUMMARIZE( 'Table', 'Table'[Document ID]), "@val", [Individual Actual VDA received from PBR])
return SUMX( summaryTable, [@val])

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.