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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.