Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
I have a dynamic Table visual using Top N filter, which is acomplished by using this dax calculation:
Top Type = IF ( ISINSCOPE ( Query1[CLIENT] ), MAXX ( TOPN ( 1, Query1, Query1[BALANCE] ), Query1[SEGMENT] ) )
What I need to do it to somehow use the Top10 Total balance as numerator, (yellow cell 73,147,638.59), and divide it by the existing attribute I already have in my table "Query1", (All Region Balance in blue cell 613,751,907.16), so that I can get to my calculation 11.92%? I would assume that Total table balance in yellow cell, which will change every month may need to be defined/captured as separate attribute/measure, so it could be dynamically used? I hope you could kindly direct me to the right solution for this? Thanks much for the help in advance. Hopefully this attachment might be helpful to explain what I am trying to accomplish here:
Solved! Go to Solution.
Hi, Wisdom Wu!
Your 4 steps are exactly what needs to be done here, however your step 2. is the most critical ("2.Create the new measure to filter the top 10 total"), and new neasure in step2 is NOT capturing correct balance for Top10?
I feel it could be one important fact about filters in my original filtered visual, that I did not communicate well using my attached mock excel table picture above. So please allow me to add some context in order to clarify little more: The Top10 Balance Sum is designed using MAXX in the syntax, bc we need to have only ONE single segment to show for every unique Client, (since clients can have multiple balances under multiple Segments too), and we need to capture only one Segment with highest Balance for each client, but at the same time combine all multiple segment balances for each client in a single row, (aggregated under column Balance). I hope this additional context might be helpful. So, would you kindly take a look in case you perhaps might have inadvertently ommited "MAXX" from my original syntax used to capture Top10 clients? I tried to add "MAXX" to your syntax in your step 2. calc, but could not make it work
Here's my syntax again:
If we can resolve capturing Top10 combined total, all other steps you suggested should work just fine.
I greatly apprecite your time and wisdom helping with this.
Best Regards,
Mk
Hi @Mk60 ,
Based on my testing, please try the following methods again:
1.Create the simple tables.
2.Create the new measure to filter the top 10 total.
Total 10 balance =
SUMX(
TOPN(
10,
ALL('Table'),
'Table'[Balance]
),
'Table'[Balance]
)
3.Create the new measure to calculate the percentage of top 10.
Top 10 percentage of total =
var _total = SUM('Table'[Balance])
var result = DIVIDE([Total 10 balance], _total)
RETURN
FORMAT(result, "#0.0%")
4.Drag the new measure into the card visual. The result is shown below.
Best Regards,
Wisdom Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, Wisdom Wu!
Your 4 steps are exactly what needs to be done here, however your step 2. is the most critical ("2.Create the new measure to filter the top 10 total"), and new neasure in step2 is NOT capturing correct balance for Top10?
I feel it could be one important fact about filters in my original filtered visual, that I did not communicate well using my attached mock excel table picture above. So please allow me to add some context in order to clarify little more: The Top10 Balance Sum is designed using MAXX in the syntax, bc we need to have only ONE single segment to show for every unique Client, (since clients can have multiple balances under multiple Segments too), and we need to capture only one Segment with highest Balance for each client, but at the same time combine all multiple segment balances for each client in a single row, (aggregated under column Balance). I hope this additional context might be helpful. So, would you kindly take a look in case you perhaps might have inadvertently ommited "MAXX" from my original syntax used to capture Top10 clients? I tried to add "MAXX" to your syntax in your step 2. calc, but could not make it work
Here's my syntax again:
If we can resolve capturing Top10 combined total, all other steps you suggested should work just fine.
I greatly apprecite your time and wisdom helping with this.
Best Regards,
Mk
User | Count |
---|---|
25 | |
11 | |
8 | |
6 | |
6 |
User | Count |
---|---|
26 | |
12 | |
11 | |
8 | |
7 |