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 August 31st. Request your voucher.

Reply
fael_66
New Member

Help with a measure to count

Hi,

i have been trying to figure this out but no luck. 

this is sample data:

Date of updateTask
10/01/2024A
15/01/2024A
15/01/2024B
23/01/2024C
10/02/2024A
28/02/2024B
03/03/2024B
25/03/2024C
30/03/2024A
01/04/2024C
15/05/2024D
20/05/2024A

 

I want to create a card that shows the following results  from it (bold data) 

number of tasks that have been updated once only= 1 task (i,e corresponds to task D)

number of tasks that have been updated 2 or 3 times = 2 task (i,e corresponds to task B & C)

number of tasks that have been updated 4 or more times= 1 task (i,e corresponds to task A)

 

instead all i have achieved is counting how many time a task has been updated. (example task A updated 5 time) this is not what im looking for.

 

any help is greatly apprreciated.

Thanks

1 ACCEPTED SOLUTION
DataInsights
Super User
Super User

@fael_66,

 

Try these measures:

 

Tasks updated once = 
VAR vTable =
    ADDCOLUMNS (
        VALUES ( 'Table'[Task] ),
        "@Count", CALCULATE ( COUNTROWS ( 'Table' ) )
    )
VAR vResult =
    COUNTROWS ( FILTER ( vTable, [@Count] = 1 ) )
RETURN
    vResult
Tasks updated 2 or 3 times = 
VAR vTable =
    ADDCOLUMNS (
        VALUES ( 'Table'[Task] ),
        "@Count", CALCULATE ( COUNTROWS ( 'Table' ) )
    )
VAR vResult =
    COUNTROWS ( FILTER ( vTable, [@Count] IN {2, 3} ) )
RETURN
    vResult
Tasks updated 4 or more times = 
VAR vTable =
    ADDCOLUMNS (
        VALUES ( 'Table'[Task] ),
        "@Count", CALCULATE ( COUNTROWS ( 'Table' ) )
    )
VAR vResult =
    COUNTROWS ( FILTER ( vTable, [@Count] >= 4 ) )
RETURN
    vResult

 

DataInsights_0-1730377575491.png

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

3 REPLIES 3
fael_66
New Member

Awsome@DataInsights , Thank you SO much. you are definitely a SUPER user:)

Thanks!





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




DataInsights
Super User
Super User

@fael_66,

 

Try these measures:

 

Tasks updated once = 
VAR vTable =
    ADDCOLUMNS (
        VALUES ( 'Table'[Task] ),
        "@Count", CALCULATE ( COUNTROWS ( 'Table' ) )
    )
VAR vResult =
    COUNTROWS ( FILTER ( vTable, [@Count] = 1 ) )
RETURN
    vResult
Tasks updated 2 or 3 times = 
VAR vTable =
    ADDCOLUMNS (
        VALUES ( 'Table'[Task] ),
        "@Count", CALCULATE ( COUNTROWS ( 'Table' ) )
    )
VAR vResult =
    COUNTROWS ( FILTER ( vTable, [@Count] IN {2, 3} ) )
RETURN
    vResult
Tasks updated 4 or more times = 
VAR vTable =
    ADDCOLUMNS (
        VALUES ( 'Table'[Task] ),
        "@Count", CALCULATE ( COUNTROWS ( 'Table' ) )
    )
VAR vResult =
    COUNTROWS ( FILTER ( vTable, [@Count] >= 4 ) )
RETURN
    vResult

 

DataInsights_0-1730377575491.png

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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