Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.
I have a formula which I use in a table. It however doesn't show a total (and yes my show total in the layout options is on. Can someone give me a solution?
Customer - Departing Revenue Customers (12m Lookback, including last rev month) =
//Hij neemt ook de omzet van de maand mee waarin de omzet wordt verloren, moet hier nog even naar kijken
VAR CurrentCustomerIsDeparting = [Customer - leaving customers (last 12 months)]
VAR LastRevenueDateForCustomer =
CALCULATE(
[Customer Last Revenue Date],
ALLEXCEPT(
KPI_EOL_sync_financial_transactionlines,
KPI_EOL_sync_financial_transactionlines[Customer Code]
)
)
-- Bepaal eerste dag van maand 12 maanden vóór LastRevenueDate
VAR LookbackStartDate =
DATE(YEAR(EDATE(LastRevenueDateForCustomer, -12)), MONTH(EDATE(LastRevenueDateForCustomer, -12)), 1)
-- Bepaal laatste dag van de maand van LastRevenueDate
VAR LookbackEndDate =
EOMONTH(LastRevenueDateForCustomer, 0)
-- Bereken omzet binnen de lookbackperiode
VAR RevenueInPeriod =
CALCULATE(
SUM(KPI_EOL_sync_financial_transactionlines[Revenue]),
FILTER(
ALL('Calendar Table'),
'Calendar Table'[Date] >= LookbackStartDate &&
'Calendar Table'[Date] <= LookbackEndDate
),
KPI_EOL_sync_financial_transactionlines[Revenue] <> 0
)
VAR Result =
IF (
CurrentCustomerIsDeparting = 1 &&
NOT(ISBLANK(LastRevenueDateForCustomer)),
RevenueInPeriod,
BLANK()
)
RETURN
IF(Result = 0, BLANK(), Result)
Solved! Go to Solution.
I fixed it myself and started from scratch. With this formula it shows which customers were lost the last 12 months.
Lost is definined as 12 full months no revevenu. So last revenue in april 2024, then 12 months not revenue will give a loss of customer in may 2025.
It calculates the lost revenue over the lost month (so april 2024 in this example) + 11 full months before that. In this case May 2023 until April 2024.
Measure 1 (made as calculated column in KPI_EOL_sync_financial_transactionlines):
Measure 2 (including a total at the bottom of a table visual):
4. If you wanna show the numbers of leaving customers in a Chart, use this one.
5. If you want to show one cumulative number for number of customers lost.
By the way "raising a ticket with the Microsoft product team' doesn't work. They don't reply.
The code for month lost is (for period), used as calculated column in KPI_EOL_sync_financial_transactionlines : As I said before I show this in my table visual, it's not necessary, but provides some insight.
The code of month lost (for date) is (used as calculated column in KPI_EOL_sync_financial_transactionlines).
My model is too extensive to break it down like this. I already told a couple of times what I expect. Think we're talking in a loop. I will just wait, maybe someone else can help with my current logic and only altering one formula, but thank you for your help
Hi @DutchMark,
If the issue still persists on your end, we recommend reaching out to our Power BI certified solution partners. These are highly experienced professionals who can provide in-depth technical assistance and offer tailored solutions based on your specific needs.
You can explore the list of trusted partners here:
Power BI Partners | Microsoft Power Platform
You’re always welcome to continue engaging with the community as well,
Should you need further assistance in the future, we encourage you to reach out via the Microsoft Fabric Community Forum and create a new thread.
we truly appreciate your active participation in the Microsoft Fabric Community.
Power BI Partners | Microsoft Power Platform
Find a Microsoft Power BI partner for implementation, consulting, or help getting started with Power BI to assist with your business intelligence needs.
Thank you.
Hi @DutchMark ,
I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions.
Thank you.
Hi @DutchMark ,
I wanted to follow up and see if you had a chance to review the information shared. If you have any further questions or need additional assistance, feel free to reach out.
Thank you.
Hi @DutchMark ,
Has your issue been resolved?If the response provided by @anilelmastasi , addressed your query, could you please confirm? It helps us ensure that the solutions provided are effective and beneficial for everyone.
Thank you.
Tejaswi.
Wow, don't be so pushy after a couple of hours and I already replied...
Shows nothing anymore
In my visual table I have a customer code, customer name (Both from the transactionalble table), a customer last revenue date measure, and Period (from my calendar table) and off course this measure.
Could you try this DAX:
Customer - Departing Revenue Customers (12m Lookback, including last rev month) =
SUMX(
VALUES(KPI_EOL_sync_financial_transactionlines[Customer Code]),
VAR CurrentCustomerIsDeparting =
CALCULATE(
[Customer - leaving customers (last 12 months)],
REMOVEFILTERS('Calendar Table') // Ensure this isn't filtered by period
)
VAR LastRevenueDateForCustomer =
CALCULATE(
[Customer Last Revenue Date],
ALLEXCEPT(
KPI_EOL_sync_financial_transactionlines,
KPI_EOL_sync_financial_transactionlines[Customer Code]
),
REMOVEFILTERS('Calendar Table') // Prevent the visual's period filter from interfering
)
VAR LookbackStartDate =
DATE(YEAR(EDATE(LastRevenueDateForCustomer, -12)), MONTH(EDATE(LastRevenueDateForCustomer, -12)), 1)
VAR LookbackEndDate =
EOMONTH(LastRevenueDateForCustomer, 0)
VAR RevenueInPeriod =
CALCULATE(
SUM(KPI_EOL_sync_financial_transactionlines[Revenue]),
FILTER(
ALL('Calendar Table'), // Important: include the full date range
'Calendar Table'[Date] >= LookbackStartDate &&
'Calendar Table'[Date] <= LookbackEndDate
),
KPI_EOL_sync_financial_transactionlines[Revenue] <> 0
)
VAR Result =
IF (
CurrentCustomerIsDeparting = 1 &&
NOT(ISBLANK(LastRevenueDateForCustomer)),
RevenueInPeriod,
BLANK()
)
RETURN IF(Result = 0, BLANK(), Result)
)
Nothing, I tried about every solution in ChatGPT and other AI tools, so I really need a very specific solution.
This code does work for example. Maybe you can get something from that. My knowledge doesn't go that far.
Hello @DutchMark ,
DAX evaluates the total row without the row context of individual customers. So your variable LastRevenueDateForCustomer gets evaluated without a specific customer, which causes the rest of the logic to break or return blank. Could you try below DAX?
Customer - Departing Revenue Customers (12m Lookback, including last rev month) =
SUMX(
VALUES(KPI_EOL_sync_financial_transactionlines[Customer Code]),
VAR CurrentCustomerIsDeparting = [Customer - leaving customers (last 12 months)]
VAR LastRevenueDateForCustomer =
CALCULATE(
[Customer Last Revenue Date],
ALLEXCEPT(
KPI_EOL_sync_financial_transactionlines,
KPI_EOL_sync_financial_transactionlines[Customer Code]
)
)
VAR LookbackStartDate =
DATE(YEAR(EDATE(LastRevenueDateForCustomer, -12)), MONTH(EDATE(LastRevenueDateForCustomer, -12)), 1)
VAR LookbackEndDate =
EOMONTH(LastRevenueDateForCustomer, 0)
VAR RevenueInPeriod =
CALCULATE(
SUM(KPI_EOL_sync_financial_transactionlines[Revenue]),
FILTER(
ALL('Calendar Table'),
'Calendar Table'[Date] >= LookbackStartDate &&
'Calendar Table'[Date] <= LookbackEndDate
),
KPI_EOL_sync_financial_transactionlines[Revenue] <> 0
)
VAR Result =
IF (
CurrentCustomerIsDeparting = 1 &&
NOT(ISBLANK(LastRevenueDateForCustomer)),
RevenueInPeriod,
BLANK()
)
RETURN
IF(Result = 0, BLANK(), Result)
)
If this solved your issue, please mark it as the accepted solution. ✅