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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Pikachu-Power
Impactful Individual
Impactful Individual

KPI question

Hello all,

 

I have following situation:

 

Unbenannt.PNG

 

Indicator for KPI is:

 

KPI_Indicator = CALCULATE(SUM(Table[Value]),
Table[Layer] = "Blue",
FILTER(Calender, Calender[Month] = MAX(Calender[Month])))
 
So I get the MAX value for quarter 3 in example. But When I use a Goel for the KPI:
 
KPI_Goal = CALCULATE(SUM(Table[Value]),
Table[Layer] = "Yellow",
FILTER(Calender, Calender[Month] = MAX(Calender[Month])))
 
I get BLANK for the Indicator. Is it somehow possibe to compare the blue value in quarter 3 with the yellow value in quarter 4?
 
Thanks!
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi  @Pikachu-Power  ,

According to your description, I create this data:

v-yangliu-msft_0-1611733762033.png

Here are the steps you can follow:

1. Create measure.

When the color is blue, the category is 1 and the maximum date:

Blue_1 =
var _1=MAXX(FILTER(ALL('Table'),'Table'[Categorie1]=1&&'Table'[Layer]="Blue"),'Table'[Date])
return
CALCULATE(SUM('Table'[Value]),FILTER(ALL('Table'),'Table'[Layer]="Blue"&&'Table'[Date]=_1))

When the color is yellow, category is 1 and the maximum date:

Yellow_1 =
var _1=MAXX(FILTER(ALL('Table'),'Table'[Categorie1]=1&&'Table'[Layer]="Yellow"),'Table'[Date])
return
CALCULATE(SUM('Table'[Value]),FILTER(ALL('Table'),'Table'[Layer]="Yellow"&&'Table'[Date]=_1))

2. Result.

v-yangliu-msft_1-1611733762056.png

 

You can downloaded PBIX file from here.

 

Best Regards,

Liu Yang

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

9 REPLIES 9
Anonymous
Not applicable

Hi  @Pikachu-Power  ,

Here are the steps you can follow:

1. Create measure.

Blue_Max = MAXX(FILTER(ALLSELECTED('Table'),'Table'[Layer]="Blue"),'Table'[Value])
Yellow_Max = MAXX(FILTER(ALLSELECTED('Table'),'Table'[Layer]="Yellow"),'Table'[Value])

2. Place the Blue_Max and Yellow_Max for comparison on the Indicator and Target goals respectively, and display the date on the Trend axis

3. Result:

v-yangliu-msft_0-1611042625321.png

You can downloaded PBIX file from here.

 

This is the related link of KPI, hope to help you:
https://docs.microsoft.com/en-us/power-bi/visuals/power-bi-visualization-kpi

 

Best Regards,

Liu Yang

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

But the SUM is missing:

 

Clients_Blue = CALCULATE(SUM(Tabelle[Value]),
Tabelle[Layer] = "Blue",
FILTER(Calender, Calender[Month] = MAX(Calender[Month])))
 
Sorry my table wasnt detailed enough. I have two additional columns Categorie1 and Categorie2 that splits the blue part in 3 tables. So I need the SUM of the MAX.
 
Another point:
I need more Filter like Table[Layer]="Blue" and Table[Layer2]="Blue2" and Table[Layer3]="Blue3". But FILTER only accept one argument. Is it possible to complete this?
Anonymous
Not applicable

Hi  @Pikachu-Power ,

Not very clear about your description... If you want more filters like table [layer] = "blue", you can use the in function


Step description:

1. First use the summrize function to find a virtual table, which is grouped by Layer and some of the largest values of the date:

v-yangliu-msft_0-1611280497681.png

2. Use the IN function to select the desired Layer

 

Here are the steps you can follow:

1. Create measure.

Blue_Yellow =
var _summrize=
SUMMARIZE('Table','Table'[Layer],
"value",MAX('Table'[Value]),
"date",MAX('Table'[Date])
)
return
CALCULATE(SUM('Table 2'[Value]),FILTER('Table 2','Table 2'[Layer] in {"Blue","Yellow"}))

2. Result.

v-yangliu-msft_1-1611280497684.png

 

You can downloaded PBIX file from here.

 

If my answer is not what you need, can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

 

Best Regards,

Liu Yang

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

Hello Liu,

 

Thanks for your reply. What i am looking for is somethink like:

 

Tab_Blue:

SUMMARIZE('Table','Table'[Categorie1],'Table'[Layer],
"value",MAX('Table'[Value]),
"date",MAX('Table'[Date])
)

 

with 'Table'[Categorie1] = 1  and 'Table'[Layer] = Blue (maybe it is possible to restrict the summarize table?) and

 

Tab_Yellow:

SUMMARIZE('Table','Table'[Categorie1],'Table'[Layer],
"value",MAX('Table'[Value]),
"date",MAX('Table'[Date])
)

 

with 'Table'[Categorie1] = 1  and 'Table'[Layer] = Yellow and final use these results in a KPI. Devide Tab_Blue / Tab_Yellow should be possible.

Anonymous
Not applicable

Hi  @Pikachu-Power  ,

According to your description, I create this data:

v-yangliu-msft_0-1611733762033.png

Here are the steps you can follow:

1. Create measure.

When the color is blue, the category is 1 and the maximum date:

Blue_1 =
var _1=MAXX(FILTER(ALL('Table'),'Table'[Categorie1]=1&&'Table'[Layer]="Blue"),'Table'[Date])
return
CALCULATE(SUM('Table'[Value]),FILTER(ALL('Table'),'Table'[Layer]="Blue"&&'Table'[Date]=_1))

When the color is yellow, category is 1 and the maximum date:

Yellow_1 =
var _1=MAXX(FILTER(ALL('Table'),'Table'[Categorie1]=1&&'Table'[Layer]="Yellow"),'Table'[Date])
return
CALCULATE(SUM('Table'[Value]),FILTER(ALL('Table'),'Table'[Layer]="Yellow"&&'Table'[Date]=_1))

2. Result.

v-yangliu-msft_1-1611733762056.png

 

You can downloaded PBIX file from here.

 

Best Regards,

Liu Yang

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

PS: The SUMMARIZE dont work. If you change for example 1600 with 2600 in Table1 for Blue 01.07.2020 then Table2 takes 2600 instead of 1800. 

amitchandak
Super User
Super User

@Pikachu-Power , In this blue and yellow should both selected in slicer or none.

 

Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hello all,

 

I have a sample pbix file in onedrive. But how to load it here? 🤔

hi all,

 

i couldnt load the pbix file without publihing private data so i will load the images:

 

12.PNG11.PNG

 

you also have to create a calender table and connect with the table. For table i created following two measures:

 

Clients_Blue = CALCULATE(SUM(Tabelle[Value]),
Tabelle[Layer] = "Blue",
FILTER(Calender, Calender[Month] = MAX(Calender[Month])))
 
Clients_Yellow = CALCULATE(SUM(Tabelle[Value]),
Tabelle[Layer] = "Yellow",
FILTER(Calender, Calender[Month] = MAX(Calender[Month])))
 
What I want is to divide the 1800 through 4100. In best case in the KPI and without doing any transformation with the dataset.

 

 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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.