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
tomcat2018
Regular Visitor

Power BI - Compare Individual vs Average data per month

Hi, imagine the scenario of sales data per store per month

 

help.JPG

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Is there any way that I would select a store from Slicer and it would compare its individual sales on all month vs the average sales of all stores on all months.

 

For example: if I select Store B from slicer, then I want a graph that would compare (3,4,5,8) vs (10,11,12,7)

 

Thanks in Advance!

1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

Hi,

 

Using Query Editor, you should first unpivot your dataset to ultimately have a 3 column dataset - Store, Month and Sales.  In a visual of your choice, select any Store in the Filter/slicer and write the following measures:

 

  1. Revenue = SUM(Data[Sales])
  2. Total revenue = CALCULATE([Revenue],ALL(Data[Store]),ALL(Data[Month]))

 

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

6 REPLIES 6
Ashish_Mathur
Super User
Super User

Hi,

 

Using Query Editor, you should first unpivot your dataset to ultimately have a 3 column dataset - Store, Month and Sales.  In a visual of your choice, select any Store in the Filter/slicer and write the following measures:

 

  1. Revenue = SUM(Data[Sales])
  2. Total revenue = CALCULATE([Revenue],ALL(Data[Store]),ALL(Data[Month]))

 

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Thanks

Thanks for your help.

MFelix
Super User
Super User

Hi @tomcat2018

If you create this two measures then you can do a 3rd measure.with difference, division or something like that.

SALES = SUM(Table[sales])
Total sales = CALCULATE ([SALES] : ALL(Table[Store]; Table[Date]))

Since measures are calculated on context if you place this on your visual should work

Regards
MFelix

Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



thanks for your help

You are welcome.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

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.