The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
Hi!
I'm trying to calculate running 12 months total with the following measure:
Solved! Go to Solution.
Hi @JesperMadsen90 ,
Please this measure:
MOVING TOTAL R12 =
VAR OneYearBack =
Filter(ALL('Date'[Date]), [Date]<=MAX ( 'Date'[Date] )&&[Date]>=EDATE(MAX ( 'Date'[Date] ),-12))
VAR Result =
CALCULATE (
VAR NumberOfMonths = COUNTROWS ( SUMMARIZE ( 'CRM Data', 'Date'[Year Month Number] ) )
VAR NoOfCustomers = [No of Customer]
VAR Result = IF ( NumberOfMonths = 12, NoOfCustomers)
RETURN
Result,
OneYearBack
)
RETURN
Result
If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thanks! I guess this measure will work as well. The solution was however very easy, the model had not connected my fact table to the date dimension table, creating the relationship solved everything.
Hi @JesperMadsen90 ,
Please this measure:
MOVING TOTAL R12 =
VAR OneYearBack =
Filter(ALL('Date'[Date]), [Date]<=MAX ( 'Date'[Date] )&&[Date]>=EDATE(MAX ( 'Date'[Date] ),-12))
VAR Result =
CALCULATE (
VAR NumberOfMonths = COUNTROWS ( SUMMARIZE ( 'CRM Data', 'Date'[Year Month Number] ) )
VAR NoOfCustomers = [No of Customer]
VAR Result = IF ( NumberOfMonths = 12, NoOfCustomers)
RETURN
Result,
OneYearBack
)
RETURN
Result
If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thanks! I guess this measure will work as well. The solution was however very easy, the model had not connected my fact table to the date dimension table, creating the relationship solved everything.
User | Count |
---|---|
15 | |
13 | |
8 | |
6 | |
6 |
User | Count |
---|---|
24 | |
19 | |
12 | |
9 | |
7 |