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.
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.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
115 | |
101 | |
78 | |
76 | |
49 |
User | Count |
---|---|
145 | |
108 | |
107 | |
89 | |
61 |