Saleh Ahmadi
Saleh Ahmadi

Reputation: 95

Converting SQL query to DAX in Power Bi to get a single value from table

I have a simple SQL query that i want to convert it to DAX so that i can use it in Power BI to create a new measure. This is the query :

SELECT [Value] FROM Core.tblConfigurations WHERE [Key] = 'ReportMinBase'

Here is the table that i want to execute this query on it :

Table Preview

I want the result of this DAX query to be just "50" in this case.

Thanks in advance.

Upvotes: 1

Views: 709

Answers (1)

Deltapimol
Deltapimol

Reputation: 176

    YourMeasure =
CALCULATE ( SUM ( TableName[Value] ), TableName[Key] = "ReportMinBase" )

The Key "ReportMinBase" is the Filter applied to retrieve the Value using the CALCULATE function. Refer https://learn.microsoft.com/en-us/dax/calculate-function-dax for CALCULATE function and its usage.

Upvotes: 1

Related Questions