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.
Hi
I want to created a calculated column bases of rows contents.
The DAX command
EVALUATE
Var _column1 ="1000"
Var _column2= "10"
Var _internaltable=SUMMARIZECOLUMNS(
Table1[Coumn1],
Table1[Column2],
FILTER(ALL(Table1),Table1[column1]=_column1 && Table1[Column2]=VALUE(_column2)),
"date1",Min(Table1[Date1]),
"date2",Min(Table1[Date2]))
var _date1 = ROW("date1",GROUPBY(_internaltable,"date1",MINX(CURRENTGROUP(),[date1)))
var _date2 = ROW("date2",GROUPBY(_internaltable,"date2",MINX(CURRENTGROUP(),[date2])))
RETURN
IF (ISBLANK(_date1),BLANK(),_date2)
The IF statement return the error "the request expression is not a valid table".
How can I do logic with the variable calculated before ( The IF will be more complex ...)
Thanks for your help
Regards
Solved! Go to Solution.
EVALUATE needs a table as a result.
So instead of
EVALUATE
Var _test="Test"
RETURN IF(ISBLANK(row("test",_test)),"Blank","Something")
you should do
EVALUATE
ROW("test",
Var _test="Test"
RETURN IF(ISBLANK(row("test",_test)),"Blank","Something")
)
There are a couple of typos in your code but I think it starts breaking down here
FILTER(ALL(Table1),Table1[column1]=_column1 && Table1[Column2]=VALUE(_column2)),
The VALUE() part is missing for _column1
It feels like your approach at the issue is a bit complex. What are you actually trying to achieve?
Hi
I need to create a column with a complex logic over milions of records.
The first step internaltable get all the needed values I will use to calculate the return value.
After that i will do some logic like:
1 date1 et date2 not blank or not equal to a value
2 if date 1 < date2 calculate the number of working day like
CALCULATE(SUM(dimdate[IsWorkingDay])-1,
DATESBETWEEN(dimdate[FullDateAlternateKey],
date1,
date2))
The error is on VAR that is saying it's not a table even if I use ROW.
I have tried a simpler formula and I got the same error.
EVALUATE
Var _test="Test"
RETURN IF(ISBLANK(row("test",_test)),"Blank","Something")
I think I miss something with var ...
If somebody can help
Regards
EVALUATE needs a table as a result.
So instead of
EVALUATE
Var _test="Test"
RETURN IF(ISBLANK(row("test",_test)),"Blank","Something")
you should do
EVALUATE
ROW("test",
Var _test="Test"
RETURN IF(ISBLANK(row("test",_test)),"Blank","Something")
)
Hi @calimero48
You can use If (isblank ) inside _date1 something like:
var _date1 = If (isblank ( ROW("date1",GROUPBY(_internaltable,"date1",MINX(CURRENTGROUP(),[date1))) , Blank() ,
ROW("date2",GROUPBY(_internaltable,"date2",MINX(CURRENTGROUP(),[date2])))
Return
_date1
Hope it helps.
Thanks,
Ankit
Covering 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 |
---|---|
46 | |
28 | |
22 | |
12 | |
8 |
User | Count |
---|---|
76 | |
51 | |
44 | |
16 | |
12 |