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
BarrbC
Frequent Visitor

Calculate scores - intervals

hello,

 

I'm struggling with  calculating scoring for my dashboard. There is a number describing the target which a respective representative has reached. Depending on the score it should be categorised to on of the score pools 1,2,3,4 or 5. How to build this formula? should it be something with IF and SWITCH?

 

should there be any dependency on the "source" table with intervals or shall it be a simple formula?

 

scoring testing 2 = switch(true(),and('Customer l data'[vs Target]> "0%",'Customer data'[vs Target] >= "79%"), "1", and('Customer data'[vs Target]>="80%" &&'Customer data'[vs Target]<= "94%"), "2", and('Customer data'[vs Target] >="95%" && 'Customer data'[vs Target]= "99%"), 3, and('Customer data'[vs Target]>="100%" && 'Customer data'[vs Target] <= "109%"), "4", and('Customer data'[vs Target] >= "110%"), "5", 0)

Your help will be much appreciated. It is taking me another day discovering how to build it into PBI. pic1.JPGpic2.JPG

1 ACCEPTED SOLUTION
PattemManohar
Community Champion
Community Champion

@BarrbC Please change the formatting for the field to "Percentage" instead of text type. Then use the below DAX as new column.

 

Score = SWITCH(TRUE(),Test41Switch[Sales]<0,1
		             ,Test41Switch[Sales]*100<=80,2
                     ,Test41Switch[Sales]*100<=95,3
                     ,Test41Switch[Sales]*100<=100,4
                     ,Test41Switch[Sales]*100>100,5
              )  

image.png





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

Proud to be a PBI Community Champion




View solution in original post

1 REPLY 1
PattemManohar
Community Champion
Community Champion

@BarrbC Please change the formatting for the field to "Percentage" instead of text type. Then use the below DAX as new column.

 

Score = SWITCH(TRUE(),Test41Switch[Sales]<0,1
		             ,Test41Switch[Sales]*100<=80,2
                     ,Test41Switch[Sales]*100<=95,3
                     ,Test41Switch[Sales]*100<=100,4
                     ,Test41Switch[Sales]*100>100,5
              )  

image.png





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

Proud to be a PBI Community Champion




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.