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.
Hi
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:
Data Table
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?
Many thanks
Solved! Go to Solution.
I entered your sample data and got the desired outcome. If you can share your pbix via one of the file services like OneDrive, I'll take a look.
Proud to be a Super User!
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
Hi, @bd_8_bc
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.
Best Regards,
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.
Proud to be a Super User!
Hi please see screenshot below of sample of data and expected outcomes, thanks
I entered your sample data and got the desired outcome. If you can share your pbix via one of the file services like OneDrive, I'll take a look.
Proud to be a Super User!
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
Proud to be a Super User!
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
97 | |
96 | |
81 | |
74 | |
66 |
User | Count |
---|---|
126 | |
106 | |
105 | |
86 | |
72 |