Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
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?
Solved! Go to 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))
Best Regards,
Qiuyun Yu
Hi @KIMPD,
Assume the data below:
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.
Best Regards,
Qiuyun Yu
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.
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))
Best Regards,
Qiuyun Yu
Thank you! This really helped
Shouldn't Status = IF(health[Code]=1;"OK!";"Error") ?
No, that is just the matter of definition of my system.
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.