This is best Fabric, Power BI, SQL and AI community event. How do we know? The last event sold out! Save €200 with code FABCMTY200.
Register nowThe Fabric community is upgrading! Read all of the details including the timeline and what you can expect. Learn more
Is there a reason why dynamic Max Rows in TOJSON does not work?
Table = {TOJSON(GENERATESERIES(1, 100000,1),-1)}
opposed to fully working TOCSV
Table = {TOCSV(GENERATESERIES(1, 100000,1),-1,"")}
@AlexisOlson @bcdobbs @CNENFRNL
Solved! Go to Solution.
There was a bug when MaxRows is -1 that was fixed recently. You need to wait for the next Desktop release. Unfortunately dynamic expression for the MaxRows parameter isn't supported.
It seems like a bug to me since it gives the following error rather than something more descriptive but, as PhilipTreacy mentioned, the official documentation doesn't say that it's supported.
Interstingly, dax.do doesn't throw an error for the query
EVALUATE {TOJSON(GENERATESERIES(1, 100000,1),-1)}
I have an application where it can become extremely useful.
I really don't care about -1. I only want an expression/dynamic expression to include all rows.
BTW it does not work too.
@jeffrey_wang can you shed some light if it is doable.
There was a bug when MaxRows is -1 that was fixed recently. You need to wait for the next Desktop release. Unfortunately dynamic expression for the MaxRows parameter isn't supported.
Hi @smpa01
Not sure why you refer to MaxRows being dynamic - you've hardcoded -1 in that formula?
But I am getting an error when using a negative value for MaxRows, even though it says you can do this. Is this the problem you are having?
Regards
Phil
Proud to be a Super User!
Hi @smpa01
As I said, I also get an error when using -1 for MaxRows. But the official Microsoft documentation makes no mention of -1 as being a valid value
TOJSON function (DAX) - DAX | Microsoft Learn
regards
Phil
Proud to be a Super User!
Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.
| User | Count |
|---|---|
| 24 | |
| 22 | |
| 20 | |
| 18 | |
| 14 |
| User | Count |
|---|---|
| 29 | |
| 23 | |
| 22 | |
| 20 | |
| 20 |