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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
JoseG
New Member

New column with show only one classifier

Hello,

 

I am somewhat new in Power BI and I have been getting along with a few tutorials but I am unable to find the answer for this topic.

My data looks somewhat like this:

 

ProjectRequired HeadsHiredHeadsTotReqHeadsbyProjectTotHeadsHiredbyProjectCategory
Red12.0014.6315.0014.63Under
Red3.000.0015.0014.63 
Blue10.007.8030.0031.45Over
Blue10.0013.6530.0031.45 
Blue10.0010.0030.0031.45 
Green22.0025.0036.0040.70Over
Green14.0015.7036.0040.70 
Yellow10.0016.8810.0016.88Over

 

The blue columns I was able to get by using SUMX, FILTER & Earlier, but I want to get the red column which shows only once the category for each project, if the total heads hired is over the total requested. E.g. the red category which has 14.83 heads hired and it needs 15, it would show Under.

 

Could you please help me out?

1 ACCEPTED SOLUTION
v-yuta-msft
Community Support
Community Support

@JoseG ,

 

Suppose the [TotReqHeadsbyProject] and [TotHeadsHiredbyProject] are both calculate columns, you only need to add an index column and create a calculate column using dax below:

Category = IF('Table'[Index] = CALCULATE(MIN('Table'[Index]), ALLEXCEPT('Table', 'Table'[Project])), IF('Table'[TotReqHeadsbyProject] > 'Table'[TotHeadsHiredbyProject], "Under", "Over"))

Capture.PNG 

Community Support Team _ Jimmy Tao

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

3 REPLIES 3
v-yuta-msft
Community Support
Community Support

@JoseG ,

 

Suppose the [TotReqHeadsbyProject] and [TotHeadsHiredbyProject] are both calculate columns, you only need to add an index column and create a calculate column using dax below:

Category = IF('Table'[Index] = CALCULATE(MIN('Table'[Index]), ALLEXCEPT('Table', 'Table'[Project])), IF('Table'[TotReqHeadsbyProject] > 'Table'[TotHeadsHiredbyProject], "Under", "Over"))

Capture.PNG 

Community Support Team _ Jimmy Tao

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Tahreem24
Super User
Super User

Hi,

You can give a try to the below measure:
MEASURE = IF(SUM(TOTAL HEAD) >SUM(TOTAL REQUIRED), SUM(TOTAL REQUIRED))

Please give Kudos to this effort and mark it as a solution if it helps!
Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard

Hi @JoseG ,

Please mark it as a solution if my answer meets your requirement so that it may help others.

 

Thanks!

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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