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 All,
I am calculating Age Category DAX formula based on the Incident logged. But i want below DAX formula to be replicated in Custom Column in Query Editor for Sorting purpose. Please provide the Custom Column formula for the below calculated column.
Age Bucket = IF('INC Logged'[Age of Incidents]>=0 && 'INC Logged'[Age of Incidents]<30,"0-30",
IF('INC Logged'[Age of Incidents]>=30 && 'INC Logged'[Age of Incidents]<60,"30-60",
IF('INC Logged'[Age of Incidents]>=60 && 'INC Logged'[Age of Incidents]<90,"60-90",
IF('INC Logged'[Age of Incidents]>=90 && 'INC Logged'[Age of Incidents]<180,"90-180",
"180+")))
)
Thanks In Advance.
Solved! Go to Solution.
Hi,
Can you please try this custom column query:
(if ([Age of Incidents]>=0 and [Age of Incidents]<30) then "0-30" else if ([Age of Incidents]>=30 and [Age of Incidents]<60) then "30-60" else if ([Age of Incidents]>=60 and [Age of Incidents]<90) then "60-90" else if ([Age of Incidents]>=90 and [Age of Incidents]<180) then "90-180" else if ([Age of Incidents]>=180 and [Age of Incidents]<90) then "180+" else "")
Thanks,
Prasanth.C
+91 9043194307
IF the value in Col A and Col B is equal to 0 then it should give me 1 else 0 along with including this third condition as if A and B both are equal to 0 it should give me "NA". This is not working for me while adding a formula in new column in power BI. How do i resolve it?
This is the condition as per Excel formula: =IF(AND(E5=0,F5<>0),1,IF(AND(E5=0,F5=0),"na",0)). However; this is not working in Power BI.
Hi,
Can you please try this custom column query:
(if ([Age of Incidents]>=0 and [Age of Incidents]<30) then "0-30" else if ([Age of Incidents]>=30 and [Age of Incidents]<60) then "30-60" else if ([Age of Incidents]>=60 and [Age of Incidents]<90) then "60-90" else if ([Age of Incidents]>=90 and [Age of Incidents]<180) then "90-180" else if ([Age of Incidents]>=180 and [Age of Incidents]<90) then "180+" else "")
Thanks,
Prasanth.C
+91 9043194307
Hi All,
Thanks @PrasanthKumar for this.
I've done something similar but now I need to build on it, replacing the values with parameters, so the client can edit the thresholds for each band. So based on the example below, my script looks like this:
CustomColumn =
(if ([Age of Incidents]>=#"Parameter1" and [Age of Incidents]<#"Parameter2") then "0-30" else if ([Age of Incidents]>=#"Parameter3" and [Age of Incidents]<#"Parameter4") then "30-60" else "")
... and so on. Error reads: The following syntax error occurred during parsing: Invalid token line 2, offset 26, #.
Any help would be gratefully received.
Thanks,
Kevin
Hi PrasanthKumar,
Its Working. Thanks for your help....
Hi,
Can you please try this custom column query :
(if ([Age of Incidents]>=0 and [Age of Incidents]<30) then "0-30" else if ([Age of Incidents]>=30 and [Age of Incidents]<60) then "30-60" else if ([Age of Incidents]>=60 and [Age of Incidents]<90) then "60-90" else if ([Age of Incidents]>=90 and [Age of Incidents]<180) then "90-180" else if ([Age of Incidents]>=180 and [Age of Incidents]<90) then "180+" else "")
Please let me know whether you got solution or not.
Thanks,
Prasanth.C
+91 9043194037
If you are looking for sorting only then You can do the sorting in the visuals/ data view also.
Thanks
Raj
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
124 | |
87 | |
85 | |
70 | |
51 |
User | Count |
---|---|
205 | |
153 | |
97 | |
79 | |
69 |