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
KIMPD
Advocate II
Advocate II

Show last value in Cards

Hi, 

 

I have difficulties with the card visualisation. I have a datasets which only contains binary values 0 and 1 for a certain period. I have converted these values in 0 --> error and 1--> OK! by making a new column with:

 

Status = IF(health[Code]=1;"Error";"OK!")

 

Next I tried to put this in a card and I wanted it to show only the last status. So for example,

 

5-6-2017 = Error

8-9-2017 = Error

31-12-201 = OK!

 

The status should thus be OK! However, I noticed the card only shows maximum or minimum value during that period and not the last value of that period. In the example, the card would only show Error; the maximum value of during the whole period.

I have tried to set the field in "last" or "first", but both did not work for me.

 

Could anyone help me?

1 ACCEPTED SOLUTION

Hi @KIMPD,

 

You can create a measure below, then put this measure in a card visual. For details, you can download attached pbix file. 

 

Measure = var maxP=CALCULATE(MAX('Table1'[Period]),ALLSELECTED(Table1))
return
CALCULATE(MAX('Table1'[Status]),FILTER('Table1','Table1'[Period]=maxP))

 

w5.PNG

 

 

Best Regards,
Qiuyun Yu 

Community Support Team _ Qiuyun Yu
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

6 REPLIES 6
v-qiuyu-msft
Community Support
Community Support

Hi @KIMPD,

 

Assume the data below: 

 

q5.PNG

 

In Power BI desktop version 2.51.4885.701 64-bit (October 2017), after place the Status calculated column to the card visual and set Last aggregation, it displays OK. You can see attached pbix file. 

 

q6.PNG

 

Best Regards,
Qiuyun Yu 

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

Dear @v-qiuyu-msft,

 

I have already tried that (I also mentioned this in the opening post:

"The status should thus be OK! However, I noticed the card only shows maximum or minimum value during that period and not the last value of that period. In the example, the card would only show Error; the maximum value of during the whole period.

I have tried to set the field in "last" or "first", but both did not work for me.")

 

Indeed this will cause the card to change in OK!, however, when you add for example a slicer and you change the period, the value will be the highest or the lowest value: see attachement. 

test.png

 

 

Hi @KIMPD,

 

You can create a measure below, then put this measure in a card visual. For details, you can download attached pbix file. 

 

Measure = var maxP=CALCULATE(MAX('Table1'[Period]),ALLSELECTED(Table1))
return
CALCULATE(MAX('Table1'[Status]),FILTER('Table1','Table1'[Period]=maxP))

 

w5.PNG

 

 

Best Regards,
Qiuyun Yu 

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

Thank you! This really helped Smiley Very Happy

Omega
Impactful Individual
Impactful Individual

Shouldn't Status = IF(health[Code]=1;"OK!";"Error") ?

No, that is just the matter of definition of my system.

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.