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
Nels921
Frequent Visitor

Count measure that doesn't change when new fields are added

I'm working on a query to identify accounts that have not submitted another form so that we can contact them and either deactivate the account or have them submit a new form for approval. This is a sample of the data I'm working with. The AccountID comes from the Accounts table and the FormID and form information from the Form table. 

 

AccountIDFormIDForm Submitted OnForm Status
C222333F4564563412-Apr-21Processed
C222333F7923048810-Apr-22Pending
C455345F8949434521-Jun-21Processed
C455345F7342306015-Jun-22Pending
C783434F5694300521-Oct-21Processed
C543405F3454954501-Aug-21Processed
C093943F2343592315-Mar-21Processed
C093943F8034955918-Apr-22Pending

 

My initial approach was to create a measure to count how many forms each account has submitted and filtering for those that have only submitted 1 form, I want to see when they submitted it and what the status is. I used this measure for the count:  

Number of Forms submitted = CALCULATE(COUNT(Formtable[FormID]),
GROUPBY(Accounts, Accounts[AccountID]))
 
then I used the Filters to select Number of Forms submitted is 1. 
Nels921_0-1664394509849.png

 

But when I try to see the Status and submitted date of these applications this is what I get 

AccountIDNumber of Forms submittedForm Submitted OnForm Status
C222333112-Apr-21Processed
C222333110-Apr-22Pending
C455345121-Jun-21Processed
C455345115-Jun-22Pending
C783434121-Oct-21Processed
C543405101-Aug-21Processed
C093943115-Mar-21Processed
C093943118-Apr-22Pending

 

Which is not correct because only accounts C783434 and C543405 have 1 form. So the desired state would be

AccountIDNumber of Forms submittedForm Submitted OnForm Status
C783434121-Oct-21Processed
C543405101-Aug-21Processed

 

I've found that when I remove the submitted on and Form Status fields, then the data looks like it should and the counts are accurate, but when I add either of these two fields it shows all the accounts with the forms submitted as 1.  I'm sure there's something wrong with my measure, I'd really appreciate some guidance on getting the desired result. 

1 ACCEPTED SOLUTION
johnt75
Super User
Super User

The columns you add into the table visual from the Forms table are acting as filters, so only one form is visible at a time. Try

Number of Forms submitted =
CALCULATE (
    COUNT ( Formtable[FormID] ),
    ALLEXCEPT ( Accounts, Accounts[AccountID] )
)

If you know that there will be only 1 entry per form in the Forms table then COUNTROWS(Formtable) would be better than the current COUNT.

View solution in original post

1 REPLY 1
johnt75
Super User
Super User

The columns you add into the table visual from the Forms table are acting as filters, so only one form is visible at a time. Try

Number of Forms submitted =
CALCULATE (
    COUNT ( Formtable[FormID] ),
    ALLEXCEPT ( Accounts, Accounts[AccountID] )
)

If you know that there will be only 1 entry per form in the Forms table then COUNTROWS(Formtable) would be better than the current COUNT.

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.