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! Learn more
Hi
I am new to Power Bi, I have a problem and hope someone will be so kind to help:
I need to calculate a variance of the Sales (Column C) by Region (Column A) between the two years (Column B)
@Anonymous ,
You may refer to the following post.
https://community.powerbi.com/t5/Desktop/Students-variations-year-over-year/m-p/345749#M155124
Hi
Thanks for your reply, but I don't see how this post helps me to resolve my DAX formula issue.
Sorry, clicked on the Post button by accident and don't know how to edit the post.
... and I also need to calculate the %.
Any help would be greatly appreciated.
Hi,
You could try the solution provided here and see if it works for you
How to create variance field and variance %
Hi
Thanks for the link, I used the formula below:
Right, looking at the code the problem here is that the fiscal year is of the data type text because it contains a hyphen.
The easiest solution would be either replace your current fiscal year column or create a duplicate fiscal year column and than remove the hyphen and change the datatype to a whole number.
In the power query you could just duplicate the column, replace the hyphen with nothing and than convert it to whole number.
Or you could create a custom column and use the following dax code
Column = SUBSTITUTE(Table[YearColumn],"-","")
Just replace the table & column with your own and format it as a whole number under the modeling tab. Then use this new column in the code and it should work.
Hi
Thanks for your reply. The variance DAX works now, but Variance % is not:
Spoke too soon, the variance doesn't work, the value in the variance column is exactly the same as the Sales column.
Please help!!!
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.