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
Patv
Helper II
Helper II

How to add where /Filter condition in DAX

Hello Friends,  I am learning Dax so please excuse if I am asking question that has already been asked but I searched and couldn't find right solution. My questions is very simple.. 

 

I have a table  Called "Table1" ( attached here) that has ID, Task Name, seqNo columns. Now I want to add a new column  Let's called it "PAD Task Name" to that table, The condition is 

Add  three space at the beginning to "Task Name" column where seqNo not equal to 0 and don't make anychnage to if seqno = 0

 

I found out how to add space at the beginning  but DON'T KNOW HOW TO apply it to only rows where  seqNo not euqal to 0 

Text.PadStart([TASK_NAME],Text.Length([TASK_NAME])+3," ")
I want result just like in "PAD Task Name"column  shown in screen shot.
Excel.png
Your help will be appeciated here. Thank you.
-Vpat
1 ACCEPTED SOLUTION
Vera_33
Resident Rockstar
Resident Rockstar

Hi @Patv 

 

Use if statement

if [Seq No] =0 then [Task Name] else "    "&[Task Name]

View solution in original post

2 REPLIES 2
Vera_33
Resident Rockstar
Resident Rockstar

Hi @Patv 

 

Use if statement

if [Seq No] =0 then [Task Name] else "    "&[Task Name]

Hi Vera_33, 

 

That's easy ! Thank you so much, it worked. Wondering why I could not think that.  Appreciate your reply. Thank you again!

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.

Top Solution Authors
Top Kudoed Authors