Forum Discussion
jayvataliya
5 years agoFrequent Visitor
Bar chart - Filter on this Visuals -> basic filtering where value = Measure
Hi All, I have a bar chart representing Company and Amount. A, B, C,... is the company name I created a measure that gives me the top 1 fail reason by amount. Eg. Wrong Input ...
- 5 years ago
Hi jayvataliya
Keep the previous measure and create a visual control measure for each visual and apply it in the visual filter:
visual control_1 = IF ( SELECTEDVALUE ( 'Source table'[FailReason] ) = [Top1 fail], 1 )Please refer the below sample file, hopes it could help.
lbendlin
5 years agoSuper User
"I created a measure that gives me the top 1 fail reason by amount."
How? Did you use RANKX ?
jayvataliya
5 years agoFrequent Visitor
Yes, you are right. I followed the below steps to get the top 1 fail reason.
- I create a separate table using SUMMARIZE() from the main dataset (Columns: Year, Month, FailReason, Amount)
- Created a measure to Sum the amount
- AmountSum = SUM('Table'[Amount])
- Created a measure that gives the rank of fail reasons by the sum of the amount
- RK = RANKX(ALL('Table'[FailReason]),[AmountSum],, DESC, Dense)
- And, created the last measure that gives me the top 1 fail reason by rank
- TopFailReason = TOPN(1,VALUES('Table'[FailReason]),CALCULATE([RK] = 2),DESC)
NOTE: here I am getting top 1 fail reason where Rank = 2(2nd fail reason)