cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
timknox Regular Visitor
Regular Visitor

Help with a 'complicated' measure

hi,

 

I am trying to write a measure, but i am stuck!!

 

Basically i have a data set - below is an example:

ItemValueDateCost WithheldPaid
1.1        234.0001/09/20180%        234.00
1.1        345.0001/10/20180%        345.00
1.1        456.0001/11/201820%        364.80
1.1        234.0001/12/201830%        163.80
1.1        345.0001/01/20190%        345.00
1.2        269.1001/09/20180%        269.10
1.2        396.7501/10/20180%        396.75
1.2        524.4001/11/201840%        314.64
1.2        269.1001/12/20180%        269.10
1.2        396.7501/01/20190%        396.75
1.3        309.4701/09/20180%        309.47
1.3        456.2601/10/20180%        456.26
1.3        603.0601/11/201820%        482.45
1.3        309.4701/12/20180%        309.47
1.3        456.2601/01/20190%        456.26

 

I have a user relationship between this table (DATA) and another table (Withhold) - example:

 

Date1.11.21.3
01/01/180%0%0%
01/02/180%0%0%
01/03/180%0%0%
01/04/180%0%0%
01/05/180%0%0%
01/06/180%0%0%
01/07/180%0%0%
01/08/180%0%0%
01/09/180%0%0%
01/10/180%0%0%
01/11/1820%40%20%
01/12/1830%0%0%
01/01/190%0%0%
01/02/190%0%0%
01/03/190%0%0%
01/04/190%0%0%
01/05/190%0%0%
01/06/190%0%0%
01/07/190%0%0%
01/08/190%0%0%
01/09/190%0%0%
01/10/190%0%0%
01/11/190%0%0%
01/12/190%0%0%
01/01/200%0%0%
01/02/200%0%0%

 

Basically I have a measure that extracts the percentage withheld, and puts the value in the corresponding line in the DATA file.  And then i have a measure that works out how much is paid (less the % withheld).

 

NOW THE PROBLEM!

 

I have another data file (Paid Date):

 

ItemDate WithheldDate Paid% Paid
1.101/11/201801/12/201810%
1.101/11/201801/01/201910%
1.101/12/201801/01/201920%
1.201/11/201801/01/201910%
1.301/12/201801/01/201920%

 

So for a particular item, elements of the % withheld are then 'released' on subsequent dates.  Example is with Item 1.1 - you will see that orriginally on the 1/11/18 20% of the cost was withheld; 10% was then released on teh 1/12/18; and 10% was released on 1/1/19.

 

I am looking for a measure that would - for example give me the total paid on say the 1/1/19 for item 1.1 - this would be made up of the 345.00 that was paid on 1/1/19, PLUS the 10% of the value that was retained on the 1/11/18 and paid on the 1/1/19 (i.e. 10% of 456.00 = 45.60), PLUS the 20% of the value that was retained on the 1/12/18 and paid on the 1/1/19 (i.e. 20% of 234.00 = 46.80)

 

Does that make sense????

 

Welcome and views please.

 

Thanks

 

 

 

 

11 REPLIES 11
Community Support Team
Community Support Team

Re: Help with a 'complicated' measure

hi, @timknox 

I'm a little confused about your description, Example is with Item 1.1 - you will see that orriginally on the 1/11/18 20% of the cost was withheld; 10% was then released on teh 1/12/18; and 10% was released on 1/1/19. I couldn't find it in the sample data table.

and what is the expected output based on these data.

 

Best Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
timknox Regular Visitor
Regular Visitor

Re: Help with a 'complicated' measure

hi Lin,

 

Thanks for your help........

 

So the released amounts and dates are in the bottom table (Paid Date).  So what we need to do is to match the 'Item No' and the 'Date Withheld', to obtain the 'Date Paid' and the '% Paid'

 

Then with this data one needs to go back to the main data set and look up what the 'Value' was for this Item - in this case it will be  456.00

 

Then we need to work out for the 1/12/18 that 10% was paid - i.e. 45.60 and this figure needs to show up in the 1/12/18 column.

 

Does that make sense?

 

Kind regards

 

Tim 

timknox Regular Visitor
Regular Visitor

Re: Help with a 'complicated' measure

is there a way i can upload a Power BI file to show you the issue?

 

timknox Regular Visitor
Regular Visitor

Re: Help with a 'complicated' measure

I have now managed to put together a sample file, with the supporting Excel data files.

 

I have included a further Excel file showing the required output.

 

The files can be downloaded here:  

 

ZIP File with data

 

Welcome and help please

Community Support Team
Community Support Team

Re: Help with a 'complicated' measure

hi, @timknox 

It seems that the link is the loss, I'm sorry what I am confused about is that in the bottom table (Paid Date) for Item 1.1, there is only 3 rows of data and how to understand "Example is with Item 1.1 - you will see that orriginally on the 1/11/18 20% of the cost was withheld; 10% was then released on teh 1/12/18; and 10% was released on 1/1/19."  

For your case, I think it is a "merge" or "lookup" case.

You can upload it to OneDrive and post the link here. Do mask sensitive data before uploading.  

 

Best Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
timknox Regular Visitor
Regular Visitor

Re: Help with a 'complicated' measure

Community Support Team
Community Support Team

Re: Help with a 'complicated' measure

HI, @timknox 

This link works, and the same point confused.

EXAMPLE FOR CONTRACT ITEM 1.1 - 20% that was withheld on 1/11/18; 10% was paid on 1/12/18 and 10% was paid on 1/1/19
EXAMPLE FOR CONTRACT ITEM 1.1 - 30% that was withheld on 1/12/18; 30% was paid on 1/1/19
EXAMPLE FOR CONTRACT ITEM 1.2 - 20% that was withheld on 1/10/18; 20% was paid on 1/12/18

12.JPG

For example

13.JPG

Do you mean it is based on the Percentage Cost Withold (Paid) table,

But why 1.3 has no data, and for 1.1 TOTAL Paid in 1/1/2019 is should 222+23.3+136.8-0=382.1

and 1.2 TOTAL Paid in 1/1/2019 is should 273.95, why it needs to add 136.80?

 

 

Best Regards,

Lin


 

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
timknox Regular Visitor
Regular Visitor

Re: Help with a 'complicated' measure

hi Lin,

 

I am sorry i am not explaining it clearly, but thank you for your help.

 

So the underlying cost data is contained in the Excel file tblFOO.  This show in the [col Total Cost] what should be paid for each [Contract Item] on the [Date].

 

However, due to contract reasons, a % is sometimes withheld until some work is completed.

 

This is measured as a % of the original [col Total Cost].

 

This is demonstrated in the sheet [Percentage Cost Withhold].  NOTE:  we do not withhold for every payment or contract item.

 

So as an example, with Contract Item 1.1, on the 1st Nov 2018 we have decided to withhold 20% of the [col Total Cost] until work is completed.  This value is 20% of 233.00 (46.60).  So on the 1/11/18 we actually pay only 186.400 (233.00 - 46.60).

 

Then, using [Percentage Cost Withold (Paid)] you will see that on the 1st Dec 2018 they had completed some of the work, and they were claiming half of the 20% withheld (shown as 10% in the table).  

 

So on 1/12/2018 we will then pay half of the value that was withheld in November - i.e. we pay 23.30 on the 1/12/18.

 

Similarly in January they claim the balance, so we pay the final 23.30 in January 2019.

 

Does that help?

timknox Regular Visitor
Regular Visitor

Re: Help with a 'complicated' measure

But why 1.3 has no data, >>>>> i just did not do the example :-)

 

 

 

and for 1.1 TOTAL Paid in 1/1/2019 is should 222+23.3+136.8-0=382.1   >>>>>> Correct - sorry

 

and 1.2 TOTAL Paid in 1/1/2019 is should 273.95, why it needs to add 136.80?   >>>>>> Correct - sorry

Helpful resources

Announcements
Back to School Contest

Back to School Contest

Engage and empower students with Power BI!

MBAS Gallery

Watch Sessions On Demand!

Continue your learning in our online communities.

Summit Australia 2019

Summit Australia 2019

Travel to Melbourne and network with thousands of peers!

Top Ideas
Users Online
Currently online: 259 members 2,884 guests
Please welcome our newest community members: