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, please I am using table variable and when i call the table name "evaluate tbl "with evaluate it works but when I use it in the context of countrows it returns the error above
*
DEFINE
VAR fsumX =
SUMMARIZE(CHA,[Employee],[YearNo],[Organisation],[MonthNamed],
"CallTimeDuration",SUM(CHA[CallTimeDuration])
)
VAR tbl =
FILTER(
fsumX,
[AvgDBanding] = "Less Than 60 Min(s)" && CHA,[Organisation] = "b" && CHA,[MonthNamed] ="November"
)
EVALUATE
COUNTROWS(tbl)
//tbl
*
I saw a similar solution that works with countrows (https://social.msdn.microsoft.com/Forums/sqlserver/en-US/42325576-064d-4fbf-bc1c-12fbd6c89728/dax-co...) but i could not get the quey for mine.
I will appreciate a guide on this
Thanks
Solved! Go to Solution.
Sorry, I thought your problem was in PBI.
In Dax Studio you need to use the following to check the result of a measure:
return
ROW("Result:", COUNTROWS(tbl))
Hi,
When I try to run the code I get an error on [AvgDBanding] does not exist.
When you add [AvgDBanding] to the FsumX / Summarize function then it will probably work.
It does work for me either as a calculated table or as a measure (with countrows, of course), but I tested it with a very simple test set.
Regards,
Thanks for the response, the return works well for me as well, but the "countrows" function on the tbl does not work, I was using the code in dax studio and it was throwing the error, but when I executed the code (countrows)in on power bi it worked, so I am guessing am missing something
Sorry, I thought your problem was in PBI.
In Dax Studio you need to use the following to check the result of a measure:
return
ROW("Result:", COUNTROWS(tbl))
Thanks - this solution definitely worked!
@JustJan Thanks for the solution, I had a look at the help of dax studio for "row" context but could not find it , can you send me on a link where i can see more on it.
@Anonymous
There is not too much explanation in the documentation, but it is a starting point: https://docs.microsoft.com/en-us/dax/row-function-dax
Hope this helps.
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 |
---|---|
47 | |
26 | |
19 | |
14 | |
10 |
User | Count |
---|---|
58 | |
50 | |
44 | |
19 | |
19 |