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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
erhan_79
Post Prodigy
Post Prodigy

DAX formula help

Dear All ; 

 

i need your kind helps about below issue 

 

i have column A with numbers and i want to create a Column B as below : 

 

If Column A is 0 , Column B will 0 

İf column A is 1,2,3,4,5 , column B will be 5 

If column A is 6,7,8,9,10,11,12,13,14,15 , column B will be 15 

İf coumn A is 16 and ıncludes higher number , column B will be 30 

 

also i want like  that for minus situation too , 

 

i added below image to make more clear 

 

thanks for your kind supports Capture.JPG

 

 

 

 

1 ACCEPTED SOLUTION
AlB
Community Champion
Community Champion

Hi @erhan_79

 

Change "ColumnA" for the exact name of your column. Seems to be "Column A"

Change "Table1" for the exact name of your table

Just use "Column B" instead of Table1[ColumnB] when creating the new column

 

View solution in original post

4 REPLIES 4
AlB
Community Champion
Community Champion

Hi @erhan_79

Try this:

 

Table1[ColumnB] = SWITCH(TRUE(),
          Table1[ColumnA]=0, 0,
          Table1[ColumnA]>=1 && Table1[ColumnA]<=5, 5,
          Table1[ColumnA]>=6 && Table1[ColumnA]<=15, 15,
          Table1[ColumnA]>=16, 30,
          Table1[ColumnA]<=-1 && Table1[ColumnA]>=-5, -5,
          Table1[ColumnA]<=-6 && Table1[ColumnA]>=-15, -15,
          Table1[ColumnA]<=-16, -30)
AlB
Community Champion
Community Champion

Hi @erhan_79

 

Change "ColumnA" for the exact name of your column. Seems to be "Column A"

Change "Table1" for the exact name of your table

Just use "Column B" instead of Table1[ColumnB] when creating the new column

 

thank you so much @AlB , great job , it is working.

Dear  @AlB;

 

thanks for your support but i got an error while creating column, i am new on power bI , could you pls share Pbix file ifit is possible that you created 

Capture.JPG

 

 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors