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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Dk_bbr
Regular Visitor

Bracket or group

My english too bad hope can understand this.

I want my customers grouping by their sales. like this group is over 100M and this one is over 50M. like premium, gold, silver 

how did you do that writing DAX or?

3 ACCEPTED SOLUTIONS
ryan_mayu
Super User
Super User

@Dk_bbr 

you can use SWITCH

 

https://learn.microsoft.com/en-us/dax/switch-function-dax?wt.mc_id=DP-MVP-5004616

 

Measure =
VAR _sales=sum('Table'[sales])
return SWITCH(TRUE(),_sales>300,"premium",_sales>100,"gold","silver")
 
11.PNG
 
pls see the attachment below




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

but like it's all of them comes together , i want to see them separated.  likw this table only showes gold members. How can i calculate this?

gold members sales
a100
b110
c

120

View solution in original post

you can filter the data that you want

11.PNG





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

4 REPLIES 4
Uzi2019
Super User
Super User

Hi @Dk_bbr 
You can try with calculated column
Group =SWITCH(TRUE(),Sales>10000000,"Premium",Sales>5000000,"Gold","Silver")

 

I hope this is what you are lookin!

Don't forget to give thumbs up and accept this as a solution if it helped you!!!
ryan_mayu
Super User
Super User

@Dk_bbr 

you can use SWITCH

 

https://learn.microsoft.com/en-us/dax/switch-function-dax?wt.mc_id=DP-MVP-5004616

 

Measure =
VAR _sales=sum('Table'[sales])
return SWITCH(TRUE(),_sales>300,"premium",_sales>100,"gold","silver")
 
11.PNG
 
pls see the attachment below




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




but like it's all of them comes together , i want to see them separated.  likw this table only showes gold members. How can i calculate this?

gold members sales
a100
b110
c

120

you can filter the data that you want

11.PNG





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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