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.
I need to create new measure that will capture only a single number, which is my Top10 total Balance in my customized table visual, (yellow cell in the attached picture). My only data table is called "Query1", and has thousands of clients, several dozens of product Types and a handfull of Regions, and much more. Each client can have several different product Types with individual balances for each type, so clients would show multiple times even with Top10 filter based on balance. In order to filter only Top10 clients, AND only show a sigle Type for each client, (one Type with largest balance only), but still total all balances for each unique client in the "Balance" column.
To acomplish my Top10 list showing only one Type for each client BUT combine all multiple Types balances for each client, I used this dax calculation, which worked great: MaxType = MAXX ( TOPN ( 1, Query1, Query1[Balance] ), Query1[TYPE] )
Now, if you could kindley direct me to the right solution to create new measure that will capture only one number, which is my "Top10-Total" Balance of 55,000,000, I would greatly appreciate your help!
Sample of my Top10 table with column names used:
Solved! Go to Solution.
Hi @Mk60
Try this:
Top10TotalBalance =
VAR TopClients =
TOPN(
10,
SUMMARIZE(
Query1,
Query1[Client],
"TotalBalance", SUM(Query1[Balance])
),
[TotalBalance], DESC
)
VAR TopClientsTable =
FILTER(
Query1,
Query1[Client] IN SELECTCOLUMNS(TopClients, "Client", [Client]) &&
Query1[Type] = [MaxType]
)
RETURN
SUMX(TopClientsTable, Query1[Balance])
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Hi @Mk60
Try this:
Top10TotalBalance =
VAR TopClients =
TOPN(
10,
SUMMARIZE(
Query1,
Query1[Client],
"TotalBalance", SUM(Query1[Balance])
),
[TotalBalance], DESC
)
VAR TopClientsTable =
FILTER(
Query1,
Query1[Client] IN SELECTCOLUMNS(TopClients, "Client", [Client]) &&
Query1[Type] = [MaxType]
)
RETURN
SUMX(TopClientsTable, Query1[Balance])
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Hi Vahid,
After I applied my existing filters that I used for my original Top10 table, I got correct Total number I wanted using your dax syntax as a new measure. It looks like I cannot drop it in a table with other attributes from my Query1 data table, and I can only use it separately with the card visual? Is that correct statement? Even if so, that will still work for me. I so much apprecite you! Before I accept this as solution, I wanted to ask you this follow up: I tried to use my new measure "Top10TotalBalance" as numerator to calculate % of grand total, and I am not getting what I should for %? My grand total, (denominator) is available in my Query1, and the column name for that is "Criticized", balance, which I want to use as denominator to calculate % of Top10.
I tied using this syntax but not gettting correct %:
Would you have better dax suggestion to capture Top10 balance as % of all Criticized balance I already have?
Thanks a ton again!
mk
User | Count |
---|---|
65 | |
62 | |
60 | |
53 | |
28 |
User | Count |
---|---|
181 | |
82 | |
67 | |
47 | |
44 |