topn with other
3 TopicsTopN + Others Pie Chart filtered by Date (Quarter and Year)
Hello fellow PowerBI enthusiasts, I have a question that I'm hoping someone could help me with. I have a table containing city codes (id_kota), credit categories (jenis_kredit), dates, and nominal values. The nominal values represent the amount of credit for each city, credit category, and date. Now, I'm trying to create a pie chart that can be filtered by date, specifically by quarter and year. The city codes consist of 39 different codes, which makes it quite challenging if I want to display all of them on the pie chart. Therefore, what I want to achieve is to show only the Top 5 city codes for each date based on the nominal values. For the remaining city codes, I'd like to group them as "Others." Additionally, it's important to have the ability to filter the chart based on the date. The pie chart example (I made it on Excel): I've watched several tutorials on YouTube and looked through the Power BI community, but the solutions I found don't quite fit my specific problem. Any assistance would be greatly appreciated. Thank you in advance!How to combine TOP 6 & BOTTOM 2 results from another DAX measure into new measure
I have linked SAP with PowerBI two different tables, one containing current year sales per product & country and the other containing previous year sales per product & country. I have created a DAX measure to calculate "vs. Prior Year" sales and now I have been asked to create a chart that will show the top 6 and bottom 2 products, so each country lead can get this info. I am trying to filter in the chart of "vs. Prior Year" both Top 6 and Bottom 2 filter, but it`s not allowing. Also, i am trying to use a new DAX measure that will combine Top 6 & bottom 2 "vs. Prior Year", however TOPN measure requires a table in the 2nd position and it doesn`t accept another DAX measure TOPN(<N_Value>, <Table>, <OrderBy_Expression>, [<Order>[, <OrderBy_Expression>, [<Order>]]…]) Any idea how I can solve this? Thank you in advance.Solved1.4KViews0likes6CommentsTopN + Others
Hi Dear Community, I have created this Table and measure in order to get Top 5 cases. Top casestable: Top Cases2 = filter(UNION(DISTINCT('Cases'[L1_SubjectDesc]), DATATABLE("L1_SubjectDesc",STRING, {{"Others"}})), not ISBLANK('Cases'[L1_SubjectDesc])) I also created 1:* relationship between this new table and Cases table. And measure to sum top 5 cases count and the rest of cases count as "Others" : Top 5 cases2 = var TopCaseTable = TOPN(5, ALLSELECTED('Top Cases2'), [Case Count]) var TopCaseCount = CALCULATE([Case Count], KEEPFILTERS(TopCaseTable)) var OtherCases = CALCULATE([Case Count], ALLSELECTED('Top Cases2')) - CALCULATE([Case Count], TopCaseTable) var CurrentCase = SELECTEDVALUE('Top Cases2'[L1_SubjectDesc]) Return IF(CurrentCase <> "Others", TopCaseCount, OtherCases) The problem: The measure seems to work on table (without adding date field though) but not on matrix. The 2 fields are from Top Cases2 table: And itdoesn't work on a stacked bar chrat. First the legend shows all the subjects instead of top 5, then it seems to not show the top 5 of the cases. with the legend, which is from the Top Cases2 table. Will appreciate your help to figure this issue out. Cheers!586Views0likes1Comment