The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
Hello,
I've created a column in my data that has a nested concatenation to determine when a cell within three particular columns has a blank value. The concatenation is working and allows me to display a user friendly message with all of the missing fields in one column. My issue is that I am unable to remove the trailing ", " from the text string that is produced. Is it possible to modify my DAX to drop the last two characters of the string?
Here is my current DAX:
Thank you!
Solved! Go to Solution.
@Anonymous Try:
QA Issue =
VAR __String = CONCATENATE(IF('Consolidated RAID Log'[Event]=BLANK(),"Missing Event, ",""),CONCATENATE(IF('Consolidated RAID Log'[Owner]=BLANK(),"Missing Owner, ",""),CONCATENATE(IF('Consolidated RAID Log'[Due Date]=BLANK(),"Missing Due Date, ",""),"")))
VAR __Result = IF(RIGHT(__String, 1) = ",", LEFT(__String, LEN(__String) - 1), __String)
RETURN
__Result
@Anonymous Try:
QA Issue =
VAR __String = CONCATENATE(IF('Consolidated RAID Log'[Event]=BLANK(),"Missing Event, ",""),CONCATENATE(IF('Consolidated RAID Log'[Owner]=BLANK(),"Missing Owner, ",""),CONCATENATE(IF('Consolidated RAID Log'[Due Date]=BLANK(),"Missing Due Date, ",""),"")))
VAR __Result = IF(RIGHT(__String, 1) = ",", LEFT(__String, LEN(__String) - 1), __String)
RETURN
__Result
Hi Greg,
Thank you so much for your quick reply. I had to make some small adjustments, but this was exactly what I needed!
I used your version and updated the Right function to look for a space and changed the - 1 to a - 2 to account for the additional space after the comma: