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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
July 2024 Power BI Update

Power BI Monthly Update - July 2024

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

PBI_Carousel_NL_June

Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.

Top Solution Authors