dax text
2 TopicsSWITCH Function with multiple hits for criteria
I recently started using Power BI a month ago. I'm currently trying to use SWITCH to sort through a column of text. The main problem that I am running into is that when a row has multiple words that satisfy the criteria for a case that I've coded for, the output column only contains the first case being satisfied, instead of all of the cases being satisfied. Here's the code I have so far: SWITCH Hits Test = SWITCH( TRUE(), CONTAINSSTRING('SWITCH Test'[Raw Data], "cat"), "cat", CONTAINSSTRING('SWITCH Test'[Raw Data], "dog"), "dog", CONTAINSSTRING('SWITCH Test'[Raw Data], "fox"), "fox", "Not Target") And here's what my table looks like: Raw Data SWITCH HitTest Ideal Result dog cat cat cat, dog dog dog dog dog dog fox dog dog, fox cat dog cat cat, dog cat cat cat cat cat fox cat cat, fox test Not Target Not Target The solution that I've come up with is to make separate columns for each SWITCH case, but I was wondering if there was another workaround/potential function I could use before doing this as it seems time intensive for larger SWITCH functions. Any help would be greatly appreciated!Solved1.5KViews0likes3CommentsAlign text in dax measure (power pivot)
Dear Sir I have created measures and Pivot Table Slicer where the user can choose measure from the slicer dynamically in the same column, the problem here is can I justify (align) each measure as per my choice by adding some line code inside the respective measure ? Centre: for measure with number output Largest Amt (By Balance) 70,000,000.00 156,016,735.80 137,727,676.84 17,596,390.93 Left: For measure with Text output Largest Client Name Ram Co Shyam Co Hari Co Immanuyal Inc2KViews0likes3Comments