Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Marcel1989
Frequent Visitor

Get value from specific column and row number

Hello,

 

let's have a table "table1" like

 

TitleTextSite
Title 1Text 1Site A
Title 2Text 2Site A
Title 3Text 3Site A
Title 4Text 4Site B
Title 5Text 5Site B

 

I need a measure that gives me the value from the column "Title" for a specific row number. The row number should be hard coded into the measure. Even it might be sound strange, but the order doesn't matter. Additionally I want to have a slicer for "Site" so that if I filter for Site="Site B" in my slicer and I use the measure for the first row, it gives me Measure(1)="Title 4".

 

I have tried the INDEX function and TOPN, but I couldn't get it work. Hope you can help me.

1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

Hi,

Please check the below picture and the attached pbix file.

 

ROWNUMBER function (DAX) - DAX | Microsoft Learn

 

Jihwan_Kim_0-1700714430164.png

 

 

Expected result measure: =
VAR _rownumber = 1
VAR _t =
    FILTER (
        ADDCOLUMNS (
            'Data',
            "@rownumber",
                ROWNUMBER (
                    SUMMARIZE ( 'Data', 'Data'[Title], 'Data'[Text], 'Data'[Site] ),
                    ORDERBY ( 'Data'[Title], ASC, 'Data'[Text], ASC ),
                    DEFAULT,
                    PARTITIONBY ( 'Data'[Site] )
                )
        ),
        [@rownumber] = _rownumber
    )
RETURN
    CONCATENATEX ( _t, Data[Title], ", " )

 


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

View solution in original post

3 REPLIES 3
Jihwan_Kim
Super User
Super User

Hi,

Please check the below picture and the attached pbix file.

 

ROWNUMBER function (DAX) - DAX | Microsoft Learn

 

Jihwan_Kim_0-1700714430164.png

 

 

Expected result measure: =
VAR _rownumber = 1
VAR _t =
    FILTER (
        ADDCOLUMNS (
            'Data',
            "@rownumber",
                ROWNUMBER (
                    SUMMARIZE ( 'Data', 'Data'[Title], 'Data'[Text], 'Data'[Site] ),
                    ORDERBY ( 'Data'[Title], ASC, 'Data'[Text], ASC ),
                    DEFAULT,
                    PARTITIONBY ( 'Data'[Site] )
                )
        ),
        [@rownumber] = _rownumber
    )
RETURN
    CONCATENATEX ( _t, Data[Title], ", " )

 


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

Hi, 
It doesn't seem to work when I have a large database, as it keeps asking me to add argument in summarize function. 

Is there a way, I can extract a specific value from a column correponding to row number 1 and show that as a card visual

Hi Jihwan_Kim,

 

thank you so much, it works. 🙂

I needed a few minutes to understand the solution and learned something new. Thanks!

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.