Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hi, I have an issue with R12 calculation (that must calculate de sum of the last 12 months). The problem is when I want to compare R12 of one year vs R12 of previous year. If a use month(january, february, etc.) they are not sorted.
The solution for me (I aceppt any others) is to calculate a measure that in september 2018, calculate de sum of september 2017.
I attach de PBI file and to images that show you what i am looking for.
Thanks a lot !
Solved! Go to Solution.
Hi @farmentano11 ,
Here are the steps you can follow:
1. Create calculated column.
Mes.Ao = 'Table'[Date]
Select [Mes.Ao] – Column tools – Data type : Date/Time – Format : March 2001.
2. Create measure.
year_month =
SUMX(
FILTER(ALL('Table'),
YEAR('Table'[Date])=YEAR(MAX('Table'[Date]))&&
MONTH('Table'[Date])=MONTH(MAX('Table'[Date]))),[Value])year_month_last =
SUMX(
FILTER(ALL('Table'),
YEAR('Table'[Date])=YEAR(MAX('Table'[Date]))-1&&
MONTH('Table'[Date])=MONTH(MAX('Table'[Date]))),[Value])
3. The Place the fields in the line graph.
Format visual – X-axis – Type – Categorical.
4. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi @farmentano11 ,
Here are the steps you can follow:
1. Create calculated column.
Mes.Ao = 'Table'[Date]
Select [Mes.Ao] – Column tools – Data type : Date/Time – Format : March 2001.
2. Create measure.
year_month =
SUMX(
FILTER(ALL('Table'),
YEAR('Table'[Date])=YEAR(MAX('Table'[Date]))&&
MONTH('Table'[Date])=MONTH(MAX('Table'[Date]))),[Value])year_month_last =
SUMX(
FILTER(ALL('Table'),
YEAR('Table'[Date])=YEAR(MAX('Table'[Date]))-1&&
MONTH('Table'[Date])=MONTH(MAX('Table'[Date]))),[Value])
3. The Place the fields in the line graph.
Format visual – X-axis – Type – Categorical.
4. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Its work! Thanks a lot
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 6 | |
| 5 | |
| 4 | |
| 4 | |
| 4 |
| User | Count |
|---|---|
| 25 | |
| 21 | |
| 10 | |
| 8 | |
| 8 |