Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!
I have a table that has 2 columns, Test_Name , Test_Value
| Test_Name | Test_Value |
| ABC | 10 |
| SDF | 12 |
| ERT | 14 |
| ASD |
I have to find the top 1 Test_name based on the Test_value
My DAX looks like this
Solved! Go to Solution.
Hi @Ethanhunt123 ,
Create a measure as below:
Measure =
CALCULATE(MAX('Table'[Test_Name]),TOPN(1,FILTER(ALL('Table'),'Table'[Test_Value]<>BLANK()),CALCULATE(MAX('Table'[Test_Value])),DESC))
And you will see:
For the related .pbix file,pls see attached.
@Ethanhunt123 You can create below simple measure to obtain the value against TOP value.
Proud to be a Super User!
Hi @Ethanhunt123 ,
Create a measure as below:
Measure =
CALCULATE(MAX('Table'[Test_Name]),TOPN(1,FILTER(ALL('Table'),'Table'[Test_Value]<>BLANK()),CALCULATE(MAX('Table'[Test_Value])),DESC))
And you will see:
For the related .pbix file,pls see attached.
Use RANKX instead of TOPN
(The name of the table in my exampe is 'TopN')
Rank Value = RANKX(ALL('TopN'), [Sum of Value],,DESC)
and if you want a measure for the top name only:
Top Name for Card Visual = CALCULATE(MAX('TopN'[Test_Name]), FILTER('TopN', [Rank Value] = 1))
Proud to be a Super User!
Paul on Linkedin.
@Ethanhunt123 , Try like measures like
measure = calculate(sum(Test_Value), filter(Table,not(isblank(Table[Test_Value]))))
CALCULATE (
[measure],
TOPN ( 1, ALL(Test_Name) , [measure] DSC),
VALUES ( test_Name )
)
The output would be Test_name, This is still giving me TEST_Name with the blank value
Vote for your favorite vizzies from the Power BI World Championship submissions!
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 64 | |
| 53 | |
| 42 | |
| 20 | |
| 17 |
| User | Count |
|---|---|
| 123 | |
| 104 | |
| 44 | |
| 32 | |
| 24 |