Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
I have a column of country codes that can occurs many times (us, ca, us, us, au, etc). I have another column with 2 words of text describing things about the country (nice + sunny, cold + rainy, etc):
1, us, warm + sunny
2, ca, cold + icy
...
In another table (related by id) I have a measure that calculates the growth (current month count - prev month count) based on the submitted date:
1, 2nd Jan 2016
2, 4th Dec 2016
...
If I do a chart with:
Axis: CountryCode
Value: Growth
Then Order by growth desc, then select the top value ('ca', 120%), I can have a word cloud that shows the top word combination that people used to describe 'ca'. If I limit the word cloud to a single result, it shows the most common combination, 'cold + snowy'.
I want to do the same, but using DAX. How to I extract this value 'cold + snowy' without having the user have to actually click the top value in the chart? I.e I want to show in the middle of the report, the most common words used in the fastest growing country.
Thanks!
Solved! Go to Solution.
Hi @tim_g,
According to your description, you should be able to use TOPN Function (DAX) and SUMMARIZE Function (DAX) to create a measure to get the top value in this scenario. The sample below is for your reference.
I assume you have the two tables like below.
Table1
Table2
1. Use the formula below to create a calculate table to get the "Id" with top Growth.
TopTable = TOPN ( 1, SUMMARIZE ( Table2, Table2[Id], "TotalGrowth", SUM ( Table2[Growth] ) ), [TotalGrowth] )
2. Then you should be able to use the formula below to create a measure to get the top value and show it within a Card visual on the report.
TopValue = CALCULATE ( FIRSTNONBLANK ( Table1[Description], 1 ), FILTER ( Table1, Table1[Id] = MAX ( 'TopTable'[Id] ) ) )
Here is the sample pbix file for your reference.
Regards
Hi @tim_g,
According to your description, you should be able to use TOPN Function (DAX) and SUMMARIZE Function (DAX) to create a measure to get the top value in this scenario. The sample below is for your reference.
I assume you have the two tables like below.
Table1
Table2
1. Use the formula below to create a calculate table to get the "Id" with top Growth.
TopTable = TOPN ( 1, SUMMARIZE ( Table2, Table2[Id], "TotalGrowth", SUM ( Table2[Growth] ) ), [TotalGrowth] )
2. Then you should be able to use the formula below to create a measure to get the top value and show it within a Card visual on the report.
TopValue = CALCULATE ( FIRSTNONBLANK ( Table1[Description], 1 ), FILTER ( Table1, Table1[Id] = MAX ( 'TopTable'[Id] ) ) )
Here is the sample pbix file for your reference.
Regards
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
107 | |
100 | |
78 | |
64 | |
58 |
User | Count |
---|---|
148 | |
113 | |
97 | |
84 | |
67 |