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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

Count Help: How many people achieved their target

Will try my best to explain what im looking for

 

So i have a table which has all the information. What im looking for is first to count the number of sold for each employee. 

CALCULATE(COUNTROWS(FILTER(Table1,Table1[Status] = "Sold")

OsamaSiddiqui_1-1658931158095.png

 
I then have another table that has the target for each employee. 
OsamaSiddiqui_4-1658932370516.png

 

 

 

OsamaSiddiqui_5-1658932480902.png

 

OsamaSiddiqui_3-1658931834212.png

This is what im trying to achieve in the end. A card that tells you how many employees achieved their target for the month selected in the filter at the top of the page. 

In our case the month selected is July and B & C are the two employees who achieved their target thus the 2 in the card

 

Any help appreciated

Thank you

1 ACCEPTED SOLUTION
tamerj1
Super User
Super User

Hi @Anonymous 
Here is a sample file with the solution https://we.tl/t-4kHt3LpgmZ

1.png2.png

Target Achieved = 
VAR T1 =
    ADDCOLUMNS (
        CROSSJOIN ( VALUES ( Names[Name] ), VALUES ( 'Date'[Month-Year] ) ),
        "@CountSold", COUNTROWS ( CALCULATETABLE ( Table1, Table1[Status] = "Sold" ) ),
        "@Target", CALCULATE ( SELECTEDVALUE ( Table2[Target] ) )
    )
VAR T2 =
    FILTER ( T1, [@CountSold] >= [@Target] )
RETURN
    COUNTROWS ( T2 )

Please feel free to let me know if you have any question

View solution in original post

3 REPLIES 3
tamerj1
Super User
Super User

Hi @Anonymous 
Here is a sample file with the solution https://we.tl/t-4kHt3LpgmZ

1.png2.png

Target Achieved = 
VAR T1 =
    ADDCOLUMNS (
        CROSSJOIN ( VALUES ( Names[Name] ), VALUES ( 'Date'[Month-Year] ) ),
        "@CountSold", COUNTROWS ( CALCULATETABLE ( Table1, Table1[Status] = "Sold" ) ),
        "@Target", CALCULATE ( SELECTEDVALUE ( Table2[Target] ) )
    )
VAR T2 =
    FILTER ( T1, [@CountSold] >= [@Target] )
RETURN
    COUNTROWS ( T2 )

Please feel free to let me know if you have any question

amitchandak
Super User
Super User

@Anonymous , Create a common table like date( using month year column , create date) and name.

 

and then you can create a measure like

Sold 1= CALCULATE(COUNTROWS(FILTER(Table1,Table1[Status] = "Sold")

Traget 1 = CALCULATE(sum(Table2[Target]))

 

Countx(filter(Name[Name]), [Sold 1] >= [Target 1] ), [Name])

 

refer

https://amitchandak.medium.com/power-bi-when-i-asked-you-to-create-common-tables-a-quick-dax-solution-8e3eccb41bda

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Hi Amit, 

Thank you for your response. I have a measure for Sold and Target just like the dax measure you mentioned in your answer. Can you explain a bit more about the common table? 

What columns should i have in the common table? 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

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.