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
Thulasiraman
Helper II
Helper II

Total Sale to show

Hi 

I have a customer sales table for 5 years.  I have created a measure to get the highest sale customer every year.  Now I wanted to create a matrix table as below.

 

Year       Highest sale        Total yearly sale

1

2

3

4

5

Want to display the customer name of the highest sale under each year.

 

When I put the yearly total sale, all my customers get displayed.  

Total yearly sale = calculate(customer sale[sales]), ALL(customer sale[customer names])

 

But I wish to display only the highest sale customer under each year and the highest sale and total yearly sale for that year.

 

Help is much appreciated.

1 ACCEPTED SOLUTION
HiraNegi
Resolver II
Resolver II

Hi @Thulasiraman ,

 

Not sure if you want to achieve this only in matrix view, but you can easily do it in tabluar view as well.

 

You can create two measures:

1. To calculate the Rank of Customer with Highest Sales, and Filter the report for the Top Rank.

2. To calculate the Total Sales by Year.

 

Below is an example with sample data.

 

Base date with sales value for Year and Product.

HiraNegi_0-1672735040736.png

 

Created two measures as below:

 
HighestSaleRank = RANKX(ALLSELECTED(Revenue[Product]), [Sales])
 
TotalYearlySale = CALCULATE([Sales], ALL(Revenue[Product]))
 
Pulled both measure in report will show up like this:
HiraNegi_1-1672735143014.png

 

Now, you may filter the report on Rank. Final output:

HiraNegi_2-1672735180845.png

 

Hope this helps.

 

Best Regards,

Hira Negi

 

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

3 REPLIES 3
HiraNegi
Resolver II
Resolver II

Hi @Thulasiraman ,

 

Not sure if you want to achieve this only in matrix view, but you can easily do it in tabluar view as well.

 

You can create two measures:

1. To calculate the Rank of Customer with Highest Sales, and Filter the report for the Top Rank.

2. To calculate the Total Sales by Year.

 

Below is an example with sample data.

 

Base date with sales value for Year and Product.

HiraNegi_0-1672735040736.png

 

Created two measures as below:

 
HighestSaleRank = RANKX(ALLSELECTED(Revenue[Product]), [Sales])
 
TotalYearlySale = CALCULATE([Sales], ALL(Revenue[Product]))
 
Pulled both measure in report will show up like this:
HiraNegi_1-1672735143014.png

 

Now, you may filter the report on Rank. Final output:

HiraNegi_2-1672735180845.png

 

Hope this helps.

 

Best Regards,

Hira Negi

 

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

 

v-stephen-msft
Community Support
Community Support

Hi @Thulasiraman ,

 

You need to have one measure that returns the highest sales per year, and then create another measure that filters customer names by the highest sales just now.

 

 

Best Regards,

Stephen Tao

 

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

 

AlB
Super User
Super User

Hi @Thulasiraman 

Can you show a sample of your data and the expected result?

 

SU18_powerbi_badge

Please accept the solution when done and consider giving a thumbs up if posts are helpful. 

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

 

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.