Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hello All, Happy new month of April.
Kindly help with this problem.."what is the total revenue generated by each product category, and how does it compare to the previous year? "
Solved! Go to Solution.
Hi,
I do not know how your semantic model looks like, but I tried to create a sample pbix file like below.
Please check the below picture and the attached pbix file whether it suits your requirement.
OFFSET function (DAX) - DAX | Microsoft Learn
% diff previous year: =
VAR _currentsales = [Sales:]
VAR _prevsales =
CALCULATE (
[Sales:],
OFFSET ( -1, ALL ( year_dim[year] ), ORDERBY ( year_dim[year], ASC ) )
)
RETURN
DIVIDE ( _currentsales - _prevsales, _prevsales )
Hi @michoolly15
Try below measure
I have taken 2 level of data
category > campaign type
so accordingly i have my measure.
and for previous year comparison
previous year= calculate( [category sum], dateadd(date,-1,year))
I hope this reolves your issue!
Hi @michoolly15
Try below measure
I have taken 2 level of data
category > campaign type
so accordingly i have my measure.
and for previous year comparison
previous year= calculate( [category sum], dateadd(date,-1,year))
I hope this reolves your issue!
Hi,
I do not know how your semantic model looks like, but I tried to create a sample pbix file like below.
Please check the below picture and the attached pbix file whether it suits your requirement.
OFFSET function (DAX) - DAX | Microsoft Learn
% diff previous year: =
VAR _currentsales = [Sales:]
VAR _prevsales =
CALCULATE (
[Sales:],
OFFSET ( -1, ALL ( year_dim[year] ), ORDERBY ( year_dim[year], ASC ) )
)
RETURN
DIVIDE ( _currentsales - _prevsales, _prevsales )
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
72 | |
71 | |
55 | |
37 | |
31 |
User | Count |
---|---|
90 | |
62 | |
61 | |
49 | |
45 |