Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
araug27
Regular Visitor

Return Custom text using DAX

Hi All, I need help with my DAX query.

 

I am trying to create a custom column that has multiple criteria and conditions. In the first segment, the code works fine where I am simply assigning an existing column text to my new column. However when I get the Bold, Underline, Italic part of my code the values return as blank in my visualization. The second part of the code is meant to go through a specific column(line descrip), find text, and return a new "label" if account number and je category are a particular value as well. It could be my syntax or how i've written it, but i havent been able to find a function in dax that allows you to return a value you want other than T/F or a number.  It essentially looks like this:

 

SWITCH(TRUE(),
(CanadaGL[account_number]) = "0", CanadaGL[gl_account_description],
(CanadaGL[account_number]) = "1", CanadaGL[gl_account_description],
(CanadaGL[account_number]) = "6", CanadaGL[gl_account_description],
(CanadaGL[account_number]) = "7", CanadaGL[gl_account_description],
(CanadaGL[account_number]) = "3", CanadaGL[gl_account_description],
(CanadaGL[account_number]) = "2", CanadaGL[gl_account_description],
(CanadaGL[account_number]) = "23", CanadaGL[gl_account_description],
(CanadaGL[account_number]) = "25", CanadaGL[gl_account_description],
(CanadaGL[account_number]) = "26", CanadaGL[gl_account_description],
(CanadaGL[account_number]) = "27", CanadaGL[gl_account_description],
(CanadaGL[account_number]) = "30", CanadaGL[gl_account_description],
(CanadaGL[account_number]) = "35", CanadaGL[gl_account_description],
(CanadaGL[account_number]) = "41", CanadaGL[gl_account_description],
(CanadaGL[account_number]) = "99", CanadaGL[gl_account_description],
(CanadaGL[account_number]) = "15", CanadaGL[gl_account_description],
(CanadaGL[account_number]) = "45", CanadaGL[gl_account_description],
(CanadaGL[account_number]) = "46", CanadaGL[gl_account_description],
(CanadaGL[account_number]) = "42", CanadaGL[gl_account_description],
(CanadaGL[account_number]) = "14", CanadaGL[gl_account_description],

CanadaGL[account_number]= "12", "Pineapple",

 


CanadaGL[account_number] = "40" && CanadaGL[je_category] = "Purchase Invoice", CanadaGL[vendor_name],

CanadaGL[account_number] = "40" && CanadaGL[je_category] = "Payroll" && SEARCH("Wellbeing", CanadaGL[line_description],"Mercer",)

CanadaGL[account_number] = "40" && CanadaGL[je_category] = "Payroll" && SEARCH("Grape",CanadaGL[line_description] ,"Grape"), "Not Mapped")

 

 

Any help would be really appreciated!

0 REPLIES 0

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.