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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.