March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hi there
I am attempting to write a report that will allow me to see any accounts that have a spending amount per month OVER a certain amount. If they do, then they are eligible for discounts etc.
I am looking for a way to look back say 12 months, and if a customer has ANY month with an amount greater tha 100,000 then return them - even if it was only 1 month.
My current measure only works if the TOTAL for the 12 months is over the amount, so not quite what i was after. Any help appreciated.
Solved! Go to Solution.
Hi,
I am not sure how your datamodel looks like, but I tried to create a sample pbix file and the sample measures like below. I amended the question to check recent four months sales per each customer, but I hope you can change this to recent 12 months in your datamodel.
I hope the below sample can provide some ideas on how to create a solution for your datamodel.
Sales measure: =
SUM(Sales[Sales])
Recent four months sales: =
CALCULATE (
[Sales measure:],
KEEPFILTERS (
DATESINPERIOD ( 'Calendar'[Date], EOMONTH ( TODAY (), 0 ), -4, MONTH )
)
)
Expected reult measure: =
COUNTROWS (
SUMMARIZE (
FILTER (
ADDCOLUMNS (
SUMMARIZE ( Sales, Customer[Customer], 'Calendar'[Month-Year] ),
"@recentfourmonthsmonthlysales", [Recent four months sales:]
),
[@recentfourmonthsmonthlysales] > 100000
),
Customer[Customer]
)
) + 0
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
Hi,
I am not sure how your datamodel looks like, but I tried to create a sample pbix file and the sample measures like below. I amended the question to check recent four months sales per each customer, but I hope you can change this to recent 12 months in your datamodel.
I hope the below sample can provide some ideas on how to create a solution for your datamodel.
Sales measure: =
SUM(Sales[Sales])
Recent four months sales: =
CALCULATE (
[Sales measure:],
KEEPFILTERS (
DATESINPERIOD ( 'Calendar'[Date], EOMONTH ( TODAY (), 0 ), -4, MONTH )
)
)
Expected reult measure: =
COUNTROWS (
SUMMARIZE (
FILTER (
ADDCOLUMNS (
SUMMARIZE ( Sales, Customer[Customer], 'Calendar'[Month-Year] ),
"@recentfourmonthsmonthlysales", [Recent four months sales:]
),
[@recentfourmonthsmonthlysales] > 100000
),
Customer[Customer]
)
) + 0
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
@plover .Assume you have measure M1 and customer dimension and Date Table
Rolling 12 = calculate(Countx(Filter( Values(Customer[Customer]), [M1] >100000 ) ,[Customer]),DATESINPERIOD('Date'[Date ],MAX('Date'[Date ]),-12,MONTH))
Rolling 12 should 1 or more or not blank
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
124 | |
87 | |
85 | |
70 | |
51 |
User | Count |
---|---|
205 | |
153 | |
97 | |
79 | |
69 |