Reputation: 95
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 :
I want the result of this DAX
query to be just "50" in this case.
Thanks in advance.
Upvotes: 1
Views: 709
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