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.
Hello,
I have a table with Data and total Sales in each month (name of monhts in polish language).
I want to add a column (by measure) in my table includes:
for each month, divide the value of the last month in the table (in this case it is March) and the value for the selected month.
for example:
- in January 2023, the sales value from March 2024 (last month) divided by the sales value from January 2023
- in February 2023, the sales value from March 2024 (last month) divided by the sales value from February 2023
Thanks for all tips how I can do that measure.
Regards,
Tomasz
Solved! Go to Solution.
Have you tried declaring a variable of LastMonth = MONTH(TODAY() -1) or DATEADD? The functions should not be affected by the row context. Then you can use the MAX at the row level for dividing by the declared variable
Thank you for your answer.
I tried what you wrote about and actually when I want to display the result in the MAX date value tab, it shows the value from the last month and it is ok.
The problem occurs when such a measure is inserted into the table as a column. MAX date is read as a value from a particular month, not the last one in the entire table. Each month itself is MAX (not the last one in the table)
Have you tried declaring a variable of LastMonth = MONTH(TODAY() -1) or DATEADD? The functions should not be affected by the row context. Then you can use the MAX at the row level for dividing by the declared variable
I did it on my own and works but thank you for your tips guys. Below details
read about ALLSELECTED
- find the MAX date in your current filter context
- find the value for that date (for example via CALCULATE)
- DIVIDE the result by the value for the "current" row
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.
User | Count |
---|---|
82 | |
42 | |
31 | |
27 | |
27 |