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

Inline KPI behaviour

Hello friends!

This is my first post here if something is not on the correct form please let me know.

 

Fist, this is my data 

id gerencia cr ValorRevisado ValorRealizado

1Gerencia ACR11500012578
2Gerencia BCR22000010000
3Gerencia ACR213001700
4Gerencia ACR3500350
5Gerencia BCR4900910
6Gerencia CCR1800750
7Gerencia CCR25000050000
8Gerencia CCR35001500

 

And this is what im trying to do:

 

 Capturar.PNG

 

 

- My rule is :

    Measure: Porcentagem = (ValorRealizado / ValorRevisado)

    Column (Image URL) = IF Porcentagem > 1: good image else bad image;

 

I can figure what is happening on table A.

 

I know what is happening on table B too but my doubt is, is this correct?

I expected somethind like table C, where the rule is applyed after the grouping..

 

1 ACCEPTED SOLUTION
v-shex-msft
Community Support
Community Support

Hi jhonatas,

 

Based on the measure, if ValorRealizado/ValorRevisado >1, displays good image otherwise it’s bad image. But from the screenshot you provided, it seems you place images in wrong location. For example:

 

1.png

 

In addition, if you want to add good or bad images after grouping, you need to create a summarize table, then place all fields in a table visual. You can follow steps below:  

 

Create the table.

Capture.PNG

 

Add measures.

 

Calculate percent:

Porcentagem =

var ValorRealizado=SUM([ValorRealizado])

var ValorRevisado=SUM([ValorRevisado])

return

CALCULATE(ValorRealizado/ValorRevisado,ALL(Test))

 

Format the result to url:

Image = if([Porcentagem]>1, "http://www.clipartbest.com/cliparts/jix/pjG/jixpjGdiE.png","http://www.freeiconspng.com/uploads/checked-correct-right-yes-checkmark-12.png")

 

Add a calculate column to store and display the url string.

 

Image Result = [Image]

Capture3.PNG

 

Capture2.PNG

 

Create visuals.

 

Table visual:

Capture4.PNGCapture5.PNG

 

Matrix visual:

Capture6.PNGCapture7.PNG

 

Use table formula to create a summarize table:

 

Table = SUMMARIZE(Test,Test[gerencia],"ValorRealizado",SUMX(FILTER(Test,Test[gerencia]=EARLIER(Test[gerencia])), Test[ValorRealizado]),"ValorRevisado",SUMX(FILTER(Test,Test[gerencia]=EARLIER(Test[gerencia])),Test[ValorRevisado]))

Capture8.PNG

 

Measure and calculate column to display image:

 

Measure = var ValorRealizado=SUM([ValorRealizado])

var ValorRevisado=SUM([ValorRevisado])

return

CALCULATE(ValorRealizado/ValorRevisado,ALL(Test))

 

Image = if([Measure]>1,"http://www.clipartbest.com/cliparts/jix/pjG/jixpjGdiE.png","http://www.freeiconspng.com/uploads/checked-correct-right-yes-checkmark-12.png")

 

Create a table visual:

Capture9.PNGCapture10.PNG

 

Regards,

Xiaoxin Sheng

 

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

9 REPLIES 9
jhonatas
Frequent Visitor

Hello! Me again!

 

Its possible to do this without creating a summarized table?

Hi @jhonatas,

 

Yes, it also support.

Create a calculated column with calculate, then use if state to check the result to return the specify image url.

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

I cant make a COLUMN work with all this variables. The context of column in this mess is getting me crazy.

Hi @jhonatas,

 

Please try to use below formula to create a column on original table:

 

Image:
var temp= calculate(SUM(Table[ValorRealizado])/SUM(Table[ValorRevisado]),Table[Gerencia]=EARLIER(Table[Gerencia]),ALLSELECTED(table))
return
if(temp>1, "http://www.clipartbest.com/cliparts/jix/pjG/jixpjGdiE.png","http://www.freeiconspng.com/uploads/checked-correct-right-yes-checkmark-12.png")

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
SimonaC
New Member

Hi guys,

 

When you move the cursor over the icons, the url pops up. Is it possible to no longer occur?

 

Thank you, 

Simona

v-shex-msft
Community Support
Community Support

Hi jhonatas,

 

Based on the measure, if ValorRealizado/ValorRevisado >1, displays good image otherwise it’s bad image. But from the screenshot you provided, it seems you place images in wrong location. For example:

 

1.png

 

In addition, if you want to add good or bad images after grouping, you need to create a summarize table, then place all fields in a table visual. You can follow steps below:  

 

Create the table.

Capture.PNG

 

Add measures.

 

Calculate percent:

Porcentagem =

var ValorRealizado=SUM([ValorRealizado])

var ValorRevisado=SUM([ValorRevisado])

return

CALCULATE(ValorRealizado/ValorRevisado,ALL(Test))

 

Format the result to url:

Image = if([Porcentagem]>1, "http://www.clipartbest.com/cliparts/jix/pjG/jixpjGdiE.png","http://www.freeiconspng.com/uploads/checked-correct-right-yes-checkmark-12.png")

 

Add a calculate column to store and display the url string.

 

Image Result = [Image]

Capture3.PNG

 

Capture2.PNG

 

Create visuals.

 

Table visual:

Capture4.PNGCapture5.PNG

 

Matrix visual:

Capture6.PNGCapture7.PNG

 

Use table formula to create a summarize table:

 

Table = SUMMARIZE(Test,Test[gerencia],"ValorRealizado",SUMX(FILTER(Test,Test[gerencia]=EARLIER(Test[gerencia])), Test[ValorRealizado]),"ValorRevisado",SUMX(FILTER(Test,Test[gerencia]=EARLIER(Test[gerencia])),Test[ValorRevisado]))

Capture8.PNG

 

Measure and calculate column to display image:

 

Measure = var ValorRealizado=SUM([ValorRealizado])

var ValorRevisado=SUM([ValorRevisado])

return

CALCULATE(ValorRealizado/ValorRevisado,ALL(Test))

 

Image = if([Measure]>1,"http://www.clipartbest.com/cliparts/jix/pjG/jixpjGdiE.png","http://www.freeiconspng.com/uploads/checked-correct-right-yes-checkmark-12.png")

 

Create a table visual:

Capture9.PNGCapture10.PNG

 

Regards,

Xiaoxin Sheng

 

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Ei xioxin, sorry for the late reply. This works perfectly! 

Let me ask, i can use this with a date slicer too?

Nevermind, my bad. Its working 100% now, thanks!

jhonatas
Frequent Visitor

maybe i need to write some more details?

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.