March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hi,
I am trying to group unique invoices by their bill value. I tried the below formula but something doesnt seem to work & I am getting an error "Argument '16' in SWITCH function is required."
Solved! Go to Solution.
Hi AmeenVanakar
I believe you simply need to remove the final comma after "Above 10000", in the line ''Unique Bill Number'[Bill Value]>10000, "Above 10000",'.
That final comma makes the switch statement believe that more arguments are coming.
_____________________________________________________
I hope my comment was helpful.
If your question was answered, please mark your post as 'Solved' and consider giving me a 'Thumbs Up'.
Find me on LinkedIn, Sessionize, or my blog Downhill Data
Corrected formula
Bill Range =
SWITCH(
TRUE(),
'Unique Bill Number'[Bill Value] <= 1000, "Below 1000",
'Unique Bill Number'[Bill Value] > 1000 && 'Unique Bill Number'[Bill Value] < 2000, "1001 - 2000",
'Unique Bill Number'[Bill Value] > 2000 && 'Unique Bill Number'[Bill Value] < 3000, "2001 - 3000",
'Unique Bill Number'[Bill Value] > 3000 && 'Unique Bill Number'[Bill Value] < 4000, "3001 - 4000",
'Unique Bill Number'[Bill Value] > 4000 && 'Unique Bill Number'[Bill Value] < 5000, "4001 - 5000",
'Unique Bill Number'[Bill Value] > 5000 && 'Unique Bill Number'[Bill Value] < 10000, "5001 - 10000",
'Unique Bill Number'[Bill Value] > 10000, "Above 10000",
"Unknown" // Default value if none of the conditions are met
)
If this helped, a Kudos 👍 or Solution mark would be great!
Cheers,
Kedar Pande
www.linkedin.com/in/kedar-pande
Hi AmeenVanakar
I believe you simply need to remove the final comma after "Above 10000", in the line ''Unique Bill Number'[Bill Value]>10000, "Above 10000",'.
That final comma makes the switch statement believe that more arguments are coming.
_____________________________________________________
I hope my comment was helpful.
If your question was answered, please mark your post as 'Solved' and consider giving me a 'Thumbs Up'.
Find me on LinkedIn, Sessionize, or my blog Downhill Data
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
114 | |
76 | |
57 | |
52 | |
44 |
User | Count |
---|---|
164 | |
116 | |
63 | |
57 | |
50 |