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
krishna0
Helper II
Helper II

Extract exactly value from row and multiply it with filtered values

Hello, folks.

 

I have an issue which bothers me and I know I am somewhere between nothing and the solution but probably lacking the experience. I have a table with allocation and availability (which is just availability from another table where it appears once per Resource - in this table it is multiplied by count of months).

krishna0_1-1632341263198.png

I need to get a number which is a multiplied value of value stored in Availability, but also reacts to count of months (it's per month) and more important - calculates people that are picked up in filter. Each person may have different Availability, but it's the same among months.

What I need is a counter which calculates sum of availability per person per month assuming only one value per person (which is accessible from another table. I even came up with something that works for singe person pick:

SumaProjektowPerMonth = divide(CALCULATE(sum(Allokacje[Availability])), [CurrProjCount],0)*[MonthCount]

but it fails for 2 or more as per below screen. I know that the sum for below two people per one month should be 192 (both have 96). For two months two people should have 384, disregarding actually picked projects (that's why I divided by projects - it multiplied by them).

krishna0_2-1632341599233.png

 

Thanks in advance for your advise!

Dominik

 

4 REPLIES 4
Anonymous
Not applicable

Try to use filtered table via variables. That is,

VAR FilteredPersonTable=ALLSELECTED('personColumn')

VAR ResultTable=ADDCOLUMNS(FilteredPersonTable,"SumOfAvailabilaty",DIVIDE(SUM(Allokacje[Availability]),[CurrProjcount]))

RETURN SUMX(ResultTable,[SumOfAvailability])*[MonthCount]

Thank you for your reply.

 

Unfortunately for one person for one year summary it gave me result of 1.95m, where it should state 96 * 12.

Sum of availability is multiplied by count of projects.

krishna0_0-1632381993160.png

#edit:

I managed to retrieve table with single values per month per resource, but I am still stuck there.

krishna0_0-1632384065514.png

 

I have evolved a little and came to surprising conclusion that my measure is not working as intended.

Below you see the code - calc count of Project is CurrProjCount - which is 4 but it does not work at all in this calculation, where it is the denominator! So in the very same sheet the very same calculation works and does not work. I have read that it may be relation problem, but this is one table (Maximum value is the one that should be correct).

krishna0_0-1632390885133.png

I even tried to put this as variable but now it shows just 1 instead of 96. The value is still 4.

krishna0_1-1632391252256.png

 

#edit:

 

This is ridiculous. 

I use variable - it is 3:

krishna0_1-1632392188015.png

I use only availability which is multiuplicated by number of projects this person is involved druing this month (and it's correct value):

krishna0_2-1632392246112.png

Now I combine both of these and suddenly pCnt does not work...

krishna0_0-1632392159509.png

 

Anyone? It seems to be really easy issue but I am too ignorant to notice it.

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.