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.
I have a Measure that uses multiple _var functions that ultimatley result in a specific "word" or "text phrase". In other words, after I type Result, I follow it with IF( _var=1, "Error" , "No Error"). When dragging the Measure into my Table, I can see the Errors and No Errors across thousands of rows. I simply want to count the number of times "Error" appears and show it in a bar graph so I can show improvement over time. Is this possible?
Hi @Anonymous
try this
Count Error Measure = CALCULATE(COUNTROWS(Table), FILTER(ALL(Table), [YourMeasure] = "Error"))
@amitchandak Below is some sample data. Pricing Unit Error is the Measure and can be seen above the table. If you can streamline this formula to make it less CPU heavy, that would be fantastic!
@az38 You solution might work, however the count function is running off of the below formula and takes up way too much CPU to calculate.
0 Pricing Unit Error =
var _ID = SELECTEDVALUE('Table'[Unique (Contract, Material, Item)])
var _Ifhaserror =
CALCULATE(
DISTINCTCOUNT('Table'[Pricing Unit]),
FILTER(
ALLSELECTED('Table'),
'Table'[Unique (Contract, Material, Item)] = _ID
)
)
var _start =
CALCULATE(
SUM('Table'[Pricing Unit]),
FILTER(
ALLSELECTED('Table'),
'Table'[Unique (Contract, Material, Item)]=_ID&&
'Table'[Contract End] =
CALCULATE(
MIN('Table'[Contract End]),
FILTER(
ALL('Table'),
'Table'[Unique (Contract, Material, Item)] = _ID
)
)
)
)
var _end =
CALCULATE(
SUM('Table'[Pricing Unit]),
FILTER(
ALLSELECTED('Table'),
'Table'[Unique (Contract, Material, Item)]=_ID&&
'Table'[Contract End] =
CALCULATE(
MAX('Table'[Contract End]),
FILTER(
ALL('Table'),
'Table'[Unique (Contract, Material, Item)] = _ID
)
)
)
)
return
IF(
_Ifhaserror=1,
"No Error",
IF(
_Ifhaserror>1&&_start=_end,
"This Error has been Corrected",
IF(
_Ifhaserror>1&&_start<>_end,
"Error"
)
)
)
Unique (Contract, Material, Item) | Contract # | Material | Item | Pricing Unit | Contract Begin | Contract End | Pricing Unit Error |
45643 5 10 | 45643 | 5 | 10 | 1000 | 11/2/2018 | 2/3/2019 | No Error |
45643 5 10 | 45643 | 5 | 10 | 1000 | 2/4/2019 | 12/31/2999 | No Error |
54353 4 10 | 54353 | 4 | 10 | 1000 | 10/10/2019 | 1/5/2020 | No Error |
54353 4 10 | 54353 | 4 | 10 | 1000 | 1/6/2020 | 12/31/2999 | No Error |
54353 7 20 | 54353 | 7 | 20 | 1000 | 10/10/2019 | 1/5/2020 | No Error |
54353 7 20 | 54353 | 7 | 20 | 1000 | 1/6/2020 | 12/31/2999 | No Error |
23455 5 10 | 23455 | 5 | 10 | 1 | 10/18/2019 | 12/31/2999 | No Error |
23455 2 20 | 23455 | 2 | 20 | 1 | 10/18/2019 | 12/31/2999 | No Error |
43543 7 10 | 43543 | 7 | 10 | 1000 | 10/18/2019 | 3/5/2020 | No Error |
43543 7 10 | 43543 | 7 | 10 | 1000 | 3/6/2020 | 3/31/2020 | No Error |
43543 7 10 | 43543 | 7 | 10 | 1000 | 4/1/2020 | 12/31/2999 | No Error |
2435 5 10 | 2435 | 5 | 10 | 1 | 11/1/2019 | 1/6/2020 | Error |
2435 5 10 | 2435 | 5 | 10 | 1000 | 1/7/2020 | 12/31/2999 | Error |
4564 8 10 | 4564 | 8 | 10 | 1 | 11/1/2019 | 1/29/2020 | Error |
4564 8 10 | 4564 | 8 | 10 | 1 | 1/30/2020 | 3/22/2020 | Error |
4564 8 10 | 4564 | 8 | 10 | 1000 | 3/23/2020 | 12/31/2999 | Error |
4564 1 20 | 4564 | 1 | 20 | 1 | 11/1/2019 | 1/29/2020 | Error |
4564 1 20 | 4564 | 1 | 20 | 1 | 1/30/2020 | 3/9/2020 | Error |
4564 1 20 | 4564 | 1 | 20 | 1 | 3/10/2020 | 3/22/2020 | Error |
4564 1 20 | 4564 | 1 | 20 | 1000 | 3/23/2020 | 12/31/2999 | Error |
765456 9 20 | 765456 | 9 | 20 | 1 | 1/1/2020 | 1/9/2020 | This Error has been Corrected |
765456 9 20 | 765456 | 9 | 20 | 1000 | 11/4/2019 | 12/31/2019 | This Error has been Corrected |
765456 9 20 | 765456 | 9 | 20 | 1000 | 1/10/2020 | 3/4/2020 | This Error has been Corrected |
765456 9 20 | 765456 | 9 | 20 | 1000 | 3/5/2020 | 3/5/2020 | This Error has been Corrected |
765456 9 20 | 765456 | 9 | 20 | 1000 | 3/6/2020 | 12/31/2999 | This Error has been Corrected
|
Hi @Anonymous ,
Is your issue solved?
Hi @Anonymous ,
@Anonymous ,Can you share sample data and sample output.
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 |
---|---|
113 | |
97 | |
84 | |
67 | |
60 |
User | Count |
---|---|
150 | |
120 | |
99 | |
87 | |
68 |