Forum Discussion
Functions and Parameters in Add Custom Column
The query editor does not use DAX. It uses the Power Query language, also known as M. Data type conversions can be done for an entire column using the buttons in the ribbon, or you can use specific type conversion functions within a custom column formula.
Here's the reference site for M functions.
Here is the reference site for the language itself.
M is case sensitive. The generic syntax for an if statement is:
if [Column Name] = "condition" then "result" else "alternative result"
I'm not sure what you're asking for with selections on a report page. Measures on a report don't interact with the query. The query executes when your dataset refreshes, not when the user makes a selection on a slicer. If your dataset uses Direct Query, I believe the report will send a new query when you change a selection, but as I understand it the query is defined by the visual and its components, not by anything done in the query editor.
can u please help me out with this...??
how can i write following in M query cus its not suppose to take in operator there:
if [AccountNumber] in ("1","2",""......"n") and another condition
then ([Rate] * [Revenue] )
else 0
apart from giving one condition for every account number with OR operato.
do we have any equivalance for 'IN' operator in Power Query..???
- Anonymous10 years agoNot applicable
To compare a value against a list of values, use the List.ContainsAny function. This function actually compares two lists, but for your purposes just think of each row of the column as a list that only contains a single item.
if List.Contains( {[AccountNumber]}, {1, 2, 3} ) and [OtherColumn] = "other condition" then ([Rate] * [Revenue]) else 0