Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hi, I have a scenario where I am trying to calculate the total amount per customer. My data is received in the following format. Each month I get a Total Amount per category per customer, and the Total is static, i.e I dont need to have a running total, I just take the value for each month.
| Date | Customer | Category | Total Amount |
| 30/08/2020 | A | Web | $100 |
| 30/08/2020 | A | Mobile | $0 |
| 30/08/2020 | B | Web | $100 |
| 30/08/2020 | B | Mobile | $100 |
| 30/09/2020 | A | Web | $500 |
| 30/09/2020 | A | Mobile | $500 |
So when I look at the data today I want the Totals for each customer to be:
| Combined Total @ Today | ||
| Customer A | $1000 | |
| Customer B | $200 | As I haven't got the Sep 2020 data for customer B the total stays as per Aug 2020. |
Next day: I refresh data and it looks like this:
| Date | Customer | Category | Total Amount |
| 30/08/2020 | A | Web | $100 |
| 30/08/2020 | A | Mobile | $0 |
| 30/08/2020 | B | Web | $100 |
| 30/08/2020 | B | Mobile | $100 |
| 30/09/2020 | A | Web | $500 |
| 30/09/2020 | A | Mobile | $500 |
| 30/09/2020 | B | Web | $200 |
So Total per Customer will be:
| Combined Total @ Today | ||
| A | $1,000 | |
| B | $300 | this is made up of $200(Web-Sep2020) + $100(Mobile-Aug2020) |
And so on it goes. once the Mobile data for September comes through I then replace the August mobile data
Solved! Go to Solution.
@av9,
Try this measure:
Amount =
VAR vMobileRows =
FILTER ( Test1, Test1[Category] = "Mobile" )
VAR vMobileMaxDate =
MAXX ( vMobileRows, Test1[Date] )
VAR vMobileLatestRow =
FILTER ( vMobileRows, Test1[Date] = vMobileMaxDate )
VAR vMobileAmount =
SUMX ( vMobileLatestRow, Test1[Total Amount] )
VAR vWebRows =
FILTER ( Test1, Test1[Category] = "Web" )
VAR vWebMaxDate =
MAXX ( vWebRows, Test1[Date] )
VAR vWebLatestRow =
FILTER ( vWebRows, Test1[Date] = vWebMaxDate )
VAR vWebAmount =
SUMX ( vWebLatestRow, Test1[Total Amount] )
VAR vResult = vMobileAmount + vWebAmount
RETURN
vResult
Today:
The next day:
Proud to be a Super User!
@av9,
Try this measure:
Amount =
VAR vMobileRows =
FILTER ( Test1, Test1[Category] = "Mobile" )
VAR vMobileMaxDate =
MAXX ( vMobileRows, Test1[Date] )
VAR vMobileLatestRow =
FILTER ( vMobileRows, Test1[Date] = vMobileMaxDate )
VAR vMobileAmount =
SUMX ( vMobileLatestRow, Test1[Total Amount] )
VAR vWebRows =
FILTER ( Test1, Test1[Category] = "Web" )
VAR vWebMaxDate =
MAXX ( vWebRows, Test1[Date] )
VAR vWebLatestRow =
FILTER ( vWebRows, Test1[Date] = vWebMaxDate )
VAR vWebAmount =
SUMX ( vWebLatestRow, Test1[Total Amount] )
VAR vResult = vMobileAmount + vWebAmount
RETURN
vResult
Today:
The next day:
Proud to be a Super User!
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.