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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
prudhvi_kumar
New Member

Logical DAX Expressions

table A

ABCD
TruefalseTruefalse

 

More than 100 columns i have like this, where True , False are there i need "yes" or "no" over there.Without create new columns is it possible to create any measure for the same.

7 REPLIES 7
Aburar_123
Resolver IV
Resolver IV

Hi @prudhvi_kumar ,

 

Please use the Power Query Transformation as below,

 

Aburar_123_0-1646896974784.png

Select Row No column then Go to Transform widow -> Unpivot Column -> Unpivot Other Columns

Aburar_123_1-1646897186483.png

it will give you the result as below,

Aburar_123_2-1646897341212.png

 

Then, Go to Add Column -> Custom Column options and write the below,

Aburar_123_3-1646897438559.png

and get the result as below,

Aburar_123_5-1646897621709.png

 

 

In the visual pane you can create the Matrix visual as below,

 

Aburar_123_6-1646897670960.png

 

If this post helps, then please Accept this as the solution. Thanks

 

 

v-chenwuz-msft
Community Support
Community Support

Hi @prudhvi_kumar ,

 

It seems no way to create a "Logical DAX" and only one by one. However, use unpivot other columns in power query to let these columns into one column, then use DAX to get the result.

vchenwuzmsft_0-1646894781297.png

 

By the way, can you share what you will do after get the result. There may be ways to bypass the need to create similar measures to get the results you want directly.

 

Best Regards

Community Support Team _ chenwu zhu

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

mwegener
Most Valuable Professional
Most Valuable Professional

Hi @prudhvi_kumar ,

 

can you customize the data type and custom format?

BooleanDAX2.png

Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast - Power BI Tutorials


johnt75
Super User
Super User

Can you use power query instead of DAX? You could transform the data during load changing TRUE to Yes and FALSE to No.

Hi @johnt75 

 

I Agree. But i have 100 columns. when i use DAX 100 extra columns will create over there(through using SWITCH/IF) is there any other option to write mesuare for all togather in one shot?

mwegener
Most Valuable Professional
Most Valuable Professional

Hi @prudhvi_kumar 

 

do you mean something like this?

Col A = IF(CONTAINS('Table A','Table A'[A], TRUE()),"yes","no")  

 

Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast - Power BI Tutorials


hi @mwegener 

 

I Agree. But i have 100 columns. when i use DAX 100 extra columns will create over there(through using SWITCH/IF) is there any other option to write mesuare for all togather in one shot?

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

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! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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