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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
Anonymous
Not applicable

Calculated column which counts totals with several filters

I've have a custom table and need to calculate some count totals on it. 

 

I'm trying to count the total amount of "yes" per date, per ID number (see example). The ID number is not unique and trying to find how many times a certain ID number has "yes" on every day. Is there a way to have a calculated column (or maybe custom table) that totals the amount of a certain word and can filter on other data?

 

Count total (calculated column)           Adjustment           Date                        ID number
2                                                           No                          29-3-2021 00:00     1
5                                                           Yes                          29-3-2021 00:00     2
3                                                           No                          29-3-2021 00:00     2
4                                                           Yes                         29-3-2021 00:00      4
3                                                           No                          30-3-2021 00:00      2

1 ACCEPTED SOLUTION
Dhacd
Resolver III
Resolver III

Hi @Anonymous 

Here is another solution for the problem that you are facing.

 

Dhacd_1-1657640200780.png

Create a calculated column by using the below dax code and use that column as a sum.

Count = 
Var _Id='Table'[ID number]
Var _Date='Table'[Date]
Var _FiltTable = Filter('Table','Table'[ID number] = _Id&& _Date ='Table'[Date]&& 'Table'[Adjustment]= "Yes")

Return  Calculate(COUNT('Table'[ID number]),_FiltTable)


If this post helps, then please consider accepting it as the solution to help the other members find it more quickly.
Regards,
Atma.
 

View solution in original post

3 REPLIES 3
Dhacd
Resolver III
Resolver III

Hi @Anonymous 

Here is another solution for the problem that you are facing.

 

Dhacd_1-1657640200780.png

Create a calculated column by using the below dax code and use that column as a sum.

Count = 
Var _Id='Table'[ID number]
Var _Date='Table'[Date]
Var _FiltTable = Filter('Table','Table'[ID number] = _Id&& _Date ='Table'[Date]&& 'Table'[Adjustment]= "Yes")

Return  Calculate(COUNT('Table'[ID number]),_FiltTable)


If this post helps, then please consider accepting it as the solution to help the other members find it more quickly.
Regards,
Atma.
 

Anonymous
Not applicable

This worked, thank you very much

Anonymous
Not applicable

Hi

 

Create a measure and use it in the report.

You can create a table visual in the report with the fields: Date, ID number and Measure; and i guess you get the expected results

 

 

 

Measure = 
COUNTROWS(
    GROUPBY(YOUR_TABLE,YOUR_TABLE[Date],YOUR_TABLE[ID number])
)

 

 

Kind regards,
José
Please mark this answer as the solution if it resolves your issue.
Appreciate your kudos! 🙂

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.