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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
ryan_mayu
Super User
Super User

How to calculate how many ppl reach the targets?

Hi all

 

I have a data format like below. Is it possible to use DAX to calculate how many ppl reach the targets?

The result should be 1 becuase only a meet the target for Q1. B doesnot met the target for Q1. C doesnot have the target, so c should be excluded.

What's more , is it possbile to calcuate how many people do not meet the target? Those people do not have targets should be excluded. The result should be 1 as well.

 

Capture.PNG

 

Thanks in advance.

Ryan





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

Proud to be a Super User!




1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi Ryan

 

Ideally you would want your Revenue and Target data in seperate tables.

Next you need a value common to both sets of data. You mention in your explanation Q1, so i guess you want to evaluate these over Quarters? So perhaps a column showin Q1, Q2 etc?

Then you simply need a DAX CALCULATE(SUM()) formula to get the sum of revenue for each name per Qtr and compare that to the Target for the same Qtr.

If you stay with a single table, you would stil ideally want the extra common colum, but then your CALCULATE(SUM())  would need to include "revenue" or "target" as criteria.

 

Quick and dirty is;

Total rev Qtr = CALCULATE(SUM(Table1[amount]),filter(Table1,Table1[datatype]="revenue" && Table1[name] = EARLIER(Table1[name]) && Table1[Qtr] = EARLIER(Table1[Qtr])))
total target Qtr = CALCULATE(SUM(Table1[amount]),filter(Table1,Table1[datatype]="target" && Table1[name] = EARLIER(Table1[name]) && Table1[Qtr] = EARLIER(Table1[Qtr])))+0
total target Qtr = CALCULATE(SUM(Table1[amount]),filter(Table1,Table1[datatype]="target" && Table1[name] = EARLIER(Table1[name]) && Table1[Qtr] = EARLIER(Table1[Qtr])))+0

ryan_mayu.PNG

As you can see, the achieved target Qtr column shows True where achieved.

View solution in original post

2 REPLIES 2
v-piga-msft
Resident Rockstar
Resident Rockstar

Hi @ryan_mayu ,

Have you solved your problem?

If you have solved, please always accept the replies making sense as solution to your question so that people who may have the same question can get the solution directly.

If you still need help, please share your desired output so that we could understand your logic better.

Best Regards,

Cherry

 

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Hi Ryan

 

Ideally you would want your Revenue and Target data in seperate tables.

Next you need a value common to both sets of data. You mention in your explanation Q1, so i guess you want to evaluate these over Quarters? So perhaps a column showin Q1, Q2 etc?

Then you simply need a DAX CALCULATE(SUM()) formula to get the sum of revenue for each name per Qtr and compare that to the Target for the same Qtr.

If you stay with a single table, you would stil ideally want the extra common colum, but then your CALCULATE(SUM())  would need to include "revenue" or "target" as criteria.

 

Quick and dirty is;

Total rev Qtr = CALCULATE(SUM(Table1[amount]),filter(Table1,Table1[datatype]="revenue" && Table1[name] = EARLIER(Table1[name]) && Table1[Qtr] = EARLIER(Table1[Qtr])))
total target Qtr = CALCULATE(SUM(Table1[amount]),filter(Table1,Table1[datatype]="target" && Table1[name] = EARLIER(Table1[name]) && Table1[Qtr] = EARLIER(Table1[Qtr])))+0
total target Qtr = CALCULATE(SUM(Table1[amount]),filter(Table1,Table1[datatype]="target" && Table1[name] = EARLIER(Table1[name]) && Table1[Qtr] = EARLIER(Table1[Qtr])))+0

ryan_mayu.PNG

As you can see, the achieved target Qtr column shows True where achieved.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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