The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
So I have a table of KPI values, all values shown in the matrix are the average of the result. For my target calculation I have a switch case as such:
Targets = SWITCH( TRUE(), 'Table'[MetricName] = "Days to Containment" && AVERAGE('Table'[Result]) > 10, "Red", 'Table'[MetricName] = "Days to Containment" && AVERAGE('Table'[Result]) > 10, "Red", "Green" )
Targets is a calculated column. In this program I am saying if the average result of a specific column name is greater than 10 then it is red if not it is green. Why does it show green for all values? I have tried it with and without the average of result.
Hi @Anonymous ,
Please try this
Targets = SWITCH( TRUE(), SELETEDVALUE('Table'[MetricName]) = "Days to Containment" && AVERAGE('Table'[Result]) > 10, "Red", SELETEDVALUE('Table'[MetricName]) = "Days to Containment" && AVERAGE('Table'[Result]) > 10, "Red", "Green" )
Best Regards
Community Support Team _ chenwu zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous
there is no row context in the marix visual. You need to add the column as a measure perhaps using SELECTEDVALUE and provide the same aggregation in the formatting measure
User | Count |
---|---|
15 | |
12 | |
8 | |
7 | |
7 |
User | Count |
---|---|
24 | |
20 | |
12 | |
9 | |
7 |