Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
plover
Advocate II
Advocate II

Calculate if any month greater than value

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.

1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

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.

 

Jihwan_Kim_1-1669008875000.png

 

 

Jihwan_Kim_0-1669008851922.png

 

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.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

View solution in original post

2 REPLIES 2
Jihwan_Kim
Super User
Super User

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.

 

Jihwan_Kim_1-1669008875000.png

 

 

Jihwan_Kim_0-1669008851922.png

 

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.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.
amitchandak
Super User
Super User

@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

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors