0

Just have a very simple question on how to index a value in PowerBI, suppose I have the following data set loaded.

enter image description here

Now, suppose I want the value 55 from the alert status column. Index wise (starting from 0), it would be (4, 2). What is the easiest way to select value 55? For example, in Python, I can go Table[4, 2].

1

1 Answer 1

1

Here is a DAX expression that returns the scalar value 55.

CALCULATE (
    SELECTEDVALUE ( 'Table'[Alert Status] ),
    'Table'[Status] = 4
)

You can quickly examine this by clicking New Table in the Modeling tab, and copy & pasting the following formula.

Test = ADDCOLUMNS (
    ROW ( "Status to Lookup", 4 ),
    "Result",
    VAR StatusToLookup = [Status to Lookup]
    RETURN CALCULATE (
        SELECTEDVALUE ( 'Table'[Alert Status] ),
        'Table'[Status] = StatusToLookup
    )
)

Output

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.