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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Syndicate_Admin
Administrator
Administrator

Monthly comparison by categories

Hello everyone.

I'm new to this power bi and dax thing and I need your help.

I have a record that contains thousands of products, each with its price and category (the category is divided into three levels in another table)

In addition, I have the date on which each of the records has been made.

I need a way to calculate and compare the evolution of prices over time (by months for example), both individually and by categories.

For example, see which are the categories/prices that have risen the most in price in the last year, or the ones that have risen the least. They have risen from one month to the next...

A small example of the table can be something like this.

ProductPriceCategoryDate
AAA5.3A01/01/2022
FIG8.2A05/02/2022
BBB1.1B01/01/2022
CCC5.3C23/05/2022
CHAPTER0.2B04/12/2022
DDD2.7A03/03/2022
GGG10.1C14/02/2022
HGT20.3C23/08/2022
AAA5.4A11/01/2022
CCC6.1C17/09/2022
BBB1.1B01/01/2022
DDD.3.1A08/03/2022
GGG9.1C29/03/2022

I imagine that we will have to calculate the average price of the category for the month in question, which is what I do not know how to do it.

I do not know if I have explained myself well or if it is necessary to clarify something.

Thanks a lot

1 ACCEPTED SOLUTION
v-rzhou-msft
Community Support
Community Support

Hi @Syndicate_Admin ,

 

If you want to calculate the average price of the category for the month, you can create a Dimdate table by CALENDAR()/CALENDARAUTO() function. Then create a measure by average function.

Data model:

RicoZhou_0-1670206907323.png

Measure:

Avg = 
AVERAGE('Table'[Price])

 Result is as below.

RicoZhou_1-1670206929055.png


Best Regards,
Rico Zhou

 

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

View solution in original post

1 REPLY 1
v-rzhou-msft
Community Support
Community Support

Hi @Syndicate_Admin ,

 

If you want to calculate the average price of the category for the month, you can create a Dimdate table by CALENDAR()/CALENDARAUTO() function. Then create a measure by average function.

Data model:

RicoZhou_0-1670206907323.png

Measure:

Avg = 
AVERAGE('Table'[Price])

 Result is as below.

RicoZhou_1-1670206929055.png


Best Regards,
Rico Zhou

 

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

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.