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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
PeterStuhr
Helper V
Helper V

Calculated column: Divide fixed number by number of rows with same ID

Hi all,

 

Imagine a table like this:

 

Capture.PNG

 

I want a calculated column to divide a fixed number (In this example 20) with the Count of Job ID's per Project ID.

 

In above example :

Project ID 1 has 4 distinct Job IDs. Therefore each Job ID is 5 (20 / 4)

Project ID 2 has 8 distinct Job IDs. Therefore each Job ID is 2.5 (20 / 😎

 

How do I achieve that?

 

 

 

2 ACCEPTED SOLUTIONS
Tahreem24
Super User
Super User

@PeterStuhr Try this measure:

MEASURE = 
VAR perJOB_ = CALCULATE(COUNT(Table[Job ID],ALLEXCEPT(TableName,ProjectID))
RETURN DIVIDE(20,perJOB_)

 

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

View solution in original post

Tahreem24
Super User
Super User

@PeterStuhr , Check the screen shot of your scenario:

Capture.JPG

 

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

View solution in original post

2 REPLIES 2
Tahreem24
Super User
Super User

@PeterStuhr , Check the screen shot of your scenario:

Capture.JPG

 

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
Tahreem24
Super User
Super User

@PeterStuhr Try this measure:

MEASURE = 
VAR perJOB_ = CALCULATE(COUNT(Table[Job ID],ALLEXCEPT(TableName,ProjectID))
RETURN DIVIDE(20,perJOB_)

 

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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

Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.