Forum Discussion
Anonymous
7 months agoNot applicable
Top 10 comparison to previous year
Hi, i am new to powerBi and i am trying to create a visual to show top 10 parts by number of repeat failure in year 2024 and get the number of failures for those parts in 2025. Things i need to add ...
- 7 months ago
Hi,
PBI file attached.
Hope this helps.
FreemanZ
Super User
7 months agohi Anonymous ,
not sure if i fully get you, try like:
1) plot a visual with data[defect part no] column and three measures like:
Failure2024 =
CALCULATE(
COUNTROWS(data),
data[Defect Year] = "2024"
)
Failure2025 =
CALCULATE(
COUNTROWS(data),
data[Defect Year] = "2025"
)
Change% = DIVIDE([Failure2025], [Failure2024])-1
2) filter the visual with a measure like below and choose 1:
filter =
VAR _2024Top3 =
CALCULATETABLE(
TOPN(
3, // change to 10 if needed
ALL(data[Defect Part No]),
CALCULATE(COUNTROWS(data))
),
data[Defect Year]="2024"
)
RETURN
IF(
MAX(data[Defect Part No]) IN _2024Top3,
1, 0
)
it works like: