Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin 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.
Hi,
I have below DAX formulas and count measure is not returning the result I am expecting:
Total_Amount = calculate(sum(Giving[Giving_Amount),ALLEXCEPT('Giving','Giving'[AccountId]))
Here is the sample data:
| Date | Amount | Account |
| Saturday, January 30, 2021 | 500 | A |
| Wednesday, December 30, 2020 | 500 | A |
| Wednesday, December 30, 2020 | 1000 | B |
| Saturday, October 10, 2020 | 15000 | C |
| Tuesday, September 1, 2020 | 5000 | D |
| Saturday, August 1, 2020 | 5000 | D |
| Monday, January 1, 2018 | 500 | A |
I changed the total amount DAX formula:
A should be included as this person spent more than $1,000 in this time period. Also, D should be excluded as this person gave more than $10000.
Hi @Anonymous ,
It is very difficult to analyze without looking at the data and just by imagining.
Could you share the sample pbix via cloud service like onedrive for business?
How-to-provide-sample-data-in-the-Power-BI-Forum
Please remove any sensitive data before uploading.
Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, please see the reply to my original post. I somehow couldn't reply to your post.
@Anonymous , I doubt current month offset has some problem,
You can get rolling 12 like
example
Rolling 12 = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date ],MAX('Date'[Date ]),-12,MONTH))
or
max Close =
var _max = maxx(allselected([Date]), 'Date'[Date])
var _min = date(year(_max)-1, month(_max),1)
return
calculate(DISTINCTCOUNT(Giving[AccountId]),filter(Giving,[Total_Amount]>=1000&&[Total_Amount]<=9999),filter('Date','Date'[Date]<=_max && 'Date'[Date]>=-_min))