Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hello, I'm look for some direction on a dax issue i'm having. I need to create a New Customer TTM (Trailing Twelve Month Measure) thats dynamic. New Customers are customers that exist within the last 12 months but not the 12 months before that. I went with a
calculated table method but i'm running into issues where the numbers are incorect on a line graph, i'm guess it's because theres no date table relationship with my calculated table. Any direction or help would be great. Below is what I have so far.
Thanks for simplifying it, I'm still running into the same date issue though. Let me know if you have any tips or solutions. This DAX might not even be the right solution, its just what came to mind.
Your date logic is fairly complicated. I think this might be a bit easier to debug:
New Customer TTM =
VAR CurrDate = MAX ( 'Date Table'[DateValue] )
VAR CustomerInvoiceCountbyBucket =
CALCULATETABLE (
ADDCOLUMNS (
VALUES ( 'P21&IBS Data'[CustomerID] ),
"lastYearInvoiceCount",
CALCULATE (
DISTINCTCOUNT ( 'P21&IBS Data'[InvoiceKey] ),
DATESINPERIOD ( 'Date Table'[DateValue], CurrDate, -1, YEAR )
),
"lastTwoInvoiceCount",
CALCULATE (
DISTINCTCOUNT ( 'P21&IBS Data'[InvoiceKey] ),
DATEADD (
DATESINPERIOD ( 'Date Table'[DateValue], CurrDate, -1, YEAR ),
-1,
YEAR
)
)
)
)
VAR newCustomers =
FILTER (
CustomerInvoiceCountbyBucket,
ISBLANK ( [lastTwoInvoiceCount] ) && [lastYearInvoiceCount] > 0
)
VAR Result = COUNTROWS ( newCustomers )
RETURN
Result
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
11 | |
11 | |
10 | |
9 | |
8 |
User | Count |
---|---|
17 | |
13 | |
12 | |
11 | |
9 |