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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
gingerclaire
Helper III
Helper III

Grading accounts in a visual based on sales total

We currently do this in excel but I would like to automate it in Power BI/Powerautomate

 

Each month we calculate the sales in the last 12 months for each account number and I then allocate it a grade based on its sales and the re-import this into our CRM

 

In power BI I have a table visual showing Account number and sales in the last 12 months. I can't do this as a calculated column in our sales data as it shows line by line results going all the way back. I need a snapshot.

 

What is the easiest way for me to add a column to my visual which grades the account as A, B or C depending on their spend?

 

Thanks in advance 🙂

 

 

1 ACCEPTED SOLUTION
Greg_Deckler
Community Champion
Community Champion

@gingerclaire Use a measure, something like:

Measure =
  VAR __Spend = SUM( 'Table'[Spend] )
  VAR __Return =
    SWITCH( TRUE(),
      __Spend < 100000, "C",
      __Spend < 500000, "B",
      "A"
    )
RETURN
  __Return


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @gingerclaire ,

 

Greg_Deckler's workaround is good. If possible, please accept his reply as solution. More people will benefit from it.

Thanks.

 

Best Regards,

Stephen Tao

Greg_Deckler
Community Champion
Community Champion

@gingerclaire Use a measure, something like:

Measure =
  VAR __Spend = SUM( 'Table'[Spend] )
  VAR __Return =
    SWITCH( TRUE(),
      __Spend < 100000, "C",
      __Spend < 500000, "B",
      "A"
    )
RETURN
  __Return


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.