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

Need help in adding a measure

Hi

I have a matrix visual included in my dashboard like shown below in the table. It basically tells for each TLs, the teams Met the target or Not. The fact table contains employee level data and the measure i have added to get the below table is =If([EmployeeCount]=0,"",if([TargetMetCount]/[EmployeeCount]>10%,"Met","Not Met")). Now i need the count of teams (sales) for each TLs who are "Met" - like show below in the Desired Outcome table.

 

TLSales 1Sales 2Sales 3Sales 4Sales 5Sales 6Sales 7
Bharath MetNot MetNot MetMet  
NikhilNot MetMetMetMet   
Abhishek MetMetMetNot MetNot Met 
Ashok    MetMetNot Met
Girish Not MetMet    
RajivNot Met  MetMetMetNot Met
Aamir  MetNot Met   
SushmaNot Met Met    
Rupika Not MetMet    
Madhu Met  Not Met  
SreejaNot Met Met    
TLDesired Outcome
Bharath2
Nikhil3
Abhishek3
Ashok2
Girish1
Rajiv3
Aamir1
Sushma1
Rupika1
Madhu1
Sreeja1
1 ACCEPTED SOLUTION
Anonymous
Not applicable

@Anonymous 

You should unpivot the table to make the dax calculations easy. 

 

1. Go to query editor, hold on Ctrl, select Sale1-7 columns, and unpivot.

2. Close and apply, create the following count measure. 

 

Measure = CALCULATE(COUNTROWS('Table'),FILTER('Table',[Value]="Met"),ALLEXCEPT('Table','Table'[TL]))

 

countmeasure.JPG

 

Paul Zheng _ Community Support Team
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
Anonymous
Not applicable

@Anonymous 

You should unpivot the table to make the dax calculations easy. 

 

1. Go to query editor, hold on Ctrl, select Sale1-7 columns, and unpivot.

2. Close and apply, create the following count measure. 

 

Measure = CALCULATE(COUNTROWS('Table'),FILTER('Table',[Value]="Met"),ALLEXCEPT('Table','Table'[TL]))

 

countmeasure.JPG

 

Paul Zheng _ Community Support Team
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

az38
Community Champion
Community Champion

Hi @Anonymous 

try this

Measure = 
CALCULATE(SUMX(Table, IF([TL Sales Measure] = "Met", 1, 0)), ALLEXCEPT(Table, Table[TL]) )

do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn
Anonymous
Not applicable

Hi

 

Thanks, but this is giving me the total number of employees. but i need the number of teams for each TL who have achieved the target.

@Anonymous , something like this

if(calculate([EmployeeCount], allexcept(Table, Table[TL])) =0,"",calculate(divide([TargetMetCount],[EmployeeCount]), allexcept(Table, Table[TL]))>10%,"Met","Not Met")

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

Am not sure if this is counting the number of teams with "Met" for each TL, am getting syntax error occured during parsing.

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.