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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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

jcalheir
Solution Supplier
Solution Supplier

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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