Relatively new to using Power BI and just a bit stuck on something.
I have my data table and the table I'am building in Power BI as below:
Statement Month Cust ID. Charge Type Charge rate %
May 22 AB1 1 5%
May 22 AB1 2 10%
June 22 AB1 1 7%
June 22 AB1 2 8%
Power BI Table (i'm creating)
Cust ID. Charge Type Charge Rate
AB1 1 7%
AB1 2 8%
The rates for each customer change on a monthly basis within the raw data, I need to pull through to my table the latest set of rates for that customer for the correct charge type based on the latest/ MAX statement date, how can I achieve this?
Solved! Go to Solution.
Hi and thanks for taking the time to respond.
It does work but I may not have been entirely clear with my question. It looks to the latest statement date however I did not mention that the customer ID may not appear in all months so it may not always be the latest months statement if the customer did not appear and could be May's statement date where the latest rate appears for the customer.
The measure does pick up the correct rates but only for customers who appear within the latest statement date but not all customers appear every month, so the measure would need to identify the latest statement month the cust ID appears in and then return the rate from there? Thanks
Can you retry DataInsights's approach?
On my side, the measure also works fine for different customers.
If your problem persists, please provide a sample file for further research.
Community Support Team _ Eason
Would you be able to provide an example of this scenario and screenshots of current and expected results? In my testing, I'm not seeing the issue.
Hi I have re entered the formula and it is now working so the error was on myside, apologies for this and thanks for your help and time spent on this, it now works perfectly.
Try this measure. In this example, I made Statement Month a date (used the 1st day of the month).
Latest Charge Rate = VAR vMaxDate = CALCULATE ( MAX ( 'DataTable'[Statement Month] ), ALLEXCEPT ( 'DataTable', 'DataTable'[Cust ID], 'DataTable'[Charge Type] ) ) VAR vResult = CALCULATE ( MAX ( 'DataTable'[Charge Rate %] ), 'DataTable'[Statement Month] = vMaxDate ) RETURN vResult