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
paulfink
Post Patron
Post Patron

Divide value but number of people and spread them equally per person

Hi guys,

 

Need some help with this.

 

I have a field that shows how many should be spent on a task.

I need to divide that field by the number of people on that task then have that divided number spread out throughout the task so each person gets an equal amount of hours to work to.

 

image.png

 

Based on my dummy data.

The hours would be divided by 3 and are spread across each of the people.

 

How could i do this?

1 ACCEPTED SOLUTION

@paulfink It basically means that one calculation is dependent upon another calculation that depends on the previous calculation. It's a DAX check to prevent recursion and it is a real pain. But, regardless of that, yes, you can make this a measure. See Page 23 of attached PBIX below sig.

Measure 23 = 
    VAR __Task = MAX([Task])
    VAR __Table = FILTER(ALL('Table (23)'),[Task]=__Task)
    VAR __Average = AVERAGEX(__Table,[Hours])
RETURN
    __Average

 


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

5 REPLIES 5
paulfink
Post Patron
Post Patron

@Greg_Deckler @amitchandak I used both of yours and got a "A circular dependency was detected"

 

I have a calc column that goes into a measure then im using that measure in the formula that is getting the circular dependency.

 

What does this mean and how do i fix it

 

Is it possible to make this into a measure?

Hi @paulfink,

Did Greg_Deckler 's sample works on your side? If this is a case, you can consider accepting his solution to help other users who faced the same scenario.

If not help, please share a dummy pbix file then we can test and troubleshoot on your formulas.

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

@paulfink It basically means that one calculation is dependent upon another calculation that depends on the previous calculation. It's a DAX check to prevent recursion and it is a real pain. But, regardless of that, yes, you can make this a measure. See Page 23 of attached PBIX below sig.

Measure 23 = 
    VAR __Task = MAX([Task])
    VAR __Table = FILTER(ALL('Table (23)'),[Task]=__Task)
    VAR __Average = AVERAGEX(__Table,[Hours])
RETURN
    __Average

 


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...
Greg_Deckler
Super User
Super User

@paulfink - Thinking:

Column = AVERAGEX(FILTER('Table',[Task]=EARLIER('Task')),[Hours])

@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...
amitchandak
Super User
Super User

@paulfink , Try like

new column =
var _1 = sumx(filter(Table,[Task] = earlier([Task])),[Hours])
var _2 = countx(filter(Table,[Task] = earlier([Task])),[Hours])
return
divide(_1,_2)

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.