Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hello Everybody, how are you?
ı have question about writing a row context dax in a ıf clause .
ı want to wrıte this query(*1) ınsıde of this query(*2). how to do that do u think?
*1:
IF A[X]="H"
THEN A[Y]*A[Z]*(-1)
ELSE IF A[X]="S"
THEN A[Y]*A[Z]
ELSE 0
-- A= TABLE NAME. X,Y,Z COLUMN NAME.
NOTE: I TRYED SWITCH FX BUT IT DOESNT WORKED.
*2:
Hello @Trist
You can try this
Measure 1 =
IF (
ISBLANK ( [Day] ),
BLANK (),
IF ( A[X] = "H", A[Y] * A[Z] * ( -1 ), IF ( A[X,] = "S", A[Y] * A[Z], 0 ) )
)
SWITCH will work. You shouldn't name your measure VALUES - that is a function in DAX. Call it something else.
New Measure =
IF(
ISBLANK( [Day] ),
BLANK(),
SWITCH(
TRUE(),
A[X] = "H",
A[Y] * A[Z] * ( -1 ),
A[X,] = "S",
A[Y] * A[Z],
0
)
)
DAX is for Analysis. Power Query is for Data Modeling
Proud to be a Super User!
MCSA: BI ReportingCovering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
47 | |
23 | |
20 | |
15 | |
13 |
User | Count |
---|---|
51 | |
42 | |
39 | |
19 | |
19 |