Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now

Reply
MalvikaBhasin
Helper III
Helper III

Comparing data over years

Hi,

 

What is a good way to present data like below:

The data will be comparitive analaysis kinds. 

 

Waytopresent.JPG

 

 

Regards

Malvika

1 ACCEPTED SOLUTION
audreygerred
Super User
Super User

Hi! You could use a matrix and have the years and months from your date table in on columns, Account in for rows and the measures you want in values.

For example, if you wanted to show your sales YoY% you could make a measure for sales:

Sales = SUM('YourTable'[SalesField])

Then, create a measure for YoY% (below assumes you have a date dim table marked as date table):

Sales YoY% =
VAR __PREV_YEAR = CALCULATE([Sales], DATEADD('Date'[Date], -1, YEAR))
RETURN
    DIVIDE([Sales] - __PREV_YEAR, __PREV_YEAR)




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





View solution in original post

3 REPLIES 3
MalvikaBhasin
Helper III
Helper III

Hi,

 

Thanks for this. I haven't ever used formulas in Power BI. Any easy alternate approach?

 

Regards

Malvika

Anonymous
Not applicable

Hi @MalvikaBhasin 

 

In fact, if you're just looking at generic display data, then the automatic aggregation provided by Power BI Matrix is sufficient, and you don't need formulas or code. However, if you want to compare data from different years, it is essential to write a measure in DAX or a custom column in M-code in Power query.

It is worth noting that Excel can easily compare data from different years, and there is no need to use formulas and codes, if you can, you can also try it.

 

Best Regards

Zhengdong Xu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

audreygerred
Super User
Super User

Hi! You could use a matrix and have the years and months from your date table in on columns, Account in for rows and the measures you want in values.

For example, if you wanted to show your sales YoY% you could make a measure for sales:

Sales = SUM('YourTable'[SalesField])

Then, create a measure for YoY% (below assumes you have a date dim table marked as date table):

Sales YoY% =
VAR __PREV_YEAR = CALCULATE([Sales], DATEADD('Date'[Date], -1, YEAR))
RETURN
    DIVIDE([Sales] - __PREV_YEAR, __PREV_YEAR)




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.