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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
po
Post Prodigy
Post Prodigy

Altering context of measure

Hi,

 

have below as can see from circled area on right shows 100% in green as when the results are aggregated to region level all are green.

 

However, the consituent rows have som reds and yellows in them - is it possible for the measure to evaluate the results at row level and consider these in which case if operated at that level would see 4 fails (i. non green) so wouldn't be 100% - ideally want the reds/yellows to be included as indicated by the arrow below.

 

screenshot4.JPG

 

 

definition of measure

 

No. of Weekly KPIs met = IF (
HASONEVALUE ( Targets[KPI Name] ),
[KPI Flag],
COUNTROWS (
FILTER ( VALUES ( Targets[KPI Name] ), CALCULATE ( SUMX ( VALUES ( Targets[KPI Name] ), [KPI Flag] ) ) >= 0 )
)
)
 
kpi flag definition below
 

KPI Flag =
SWITCH(
TRUE(),

MAX(Targets[KPI Unit]) = "£",
SWITCH(TRUE(),

[KPI Currency Value] > [KPI Currency Target Max],-1,
[KPI Currency Value] <= [KPI Currency Target Max] &&
[KPI Currency Value] > [KPI Currency Target Min],0,1),

MAX(Targets[KPI Unit]) = "%" ,
SWITCH(TRUE(),

[KPI Percentage Value] < [KPI Percentage Target Max],-1,
[KPI Percentage Value] >= [KPI Percentage Target Max] &&
[KPI Percentage Value] < [KPI Percentage Target Min],0,1),

MAX(Targets[KPI Unit]) = "#",
SWITCH(TRUE(),

[KPI Score Value] > [KPI Score Target Max],-1,
[KPI Score Value] <= [KPI Score Target Max] &&
[KPI Score Value] > [KPI Score Target Min],0,1),


-2
)

3 REPLIES 3
v-cherch-msft
Microsoft Employee
Microsoft Employee

Hi @po 

It seems you may need to use conditional formatting .For further,you may have a look at this post.If it is not your case,please share some data sample and expected output.

How to Get Your Question Answered Quickly

Regards,

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi,

 

Thanks for reply - have conditional formatting.

 

can't upload this particular data unfortunately.

 

By default the measure being evaluated at the region context i.e gets the sums at regional level and because at regional level all passed i.e.  green shows 100%.

 

Wondered if way to instead say results at constituent level (i.e. city) e.g if sum (<measure>) at city can see some cities in the region failed some measures thus would be < 100%

 

Thanks

 

 

v-cherch-msft
Microsoft Employee
Microsoft Employee

Hi @po 

Based on my test,i cannot reproduce the same issue.Could you provide some simplified assumed data to reproduce your scenario?

Regards,

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.