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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
stino123
Helper II
Helper II

Multiple IF functions with filter

Hey All,

 

I have the following dax formula, the purpose of which is to create different customer profiles. So dependent on the "order quantity" of each distinct "% key customer" return either: Low,medium,high or top. It works if I put a matrix table with key customer next to customer categories and order count. However when I just put the "Customer category" in a matrix it will return just the value "top". I would like to have this new measure show all of the categories in a matrix (Low,medium,high or top) so I can compare sales value. Thanks in advance!

 

stino123_0-1645435758897.png

 

2 REPLIES 2
v-yanjiang-msft
Community Support
Community Support

Hi @stino123 ,

I'm not clear what's the relationship of customer category and Key customer, could you please explain more or give a simple example of your data?

Best Regards,
Community Support Team _ kalyj

 

ValtteriN
Super User
Super User

Hi,

Try uisng SWITCH + TRUE to achieve this. The basic structure is as follows: SWITCH(TRUE(),condition1, result1,
condition2, result2 ...
)

To get this to show in matrix I recommend creating a new table e.g. Table = {("Low"),("Medium"),("High"),("Top")}

Then use this table in comination with your category measure to get the desired end result.

E.g. Filter = If(Table[Value]=[Measure],1,0)

Place this as a visual filter to enable slicing based on category. (Filters on this visual: Filter is 1)

Then you can create e.g. count measures to get values based pn category:

Bool High = IF([Measure]="High",1,0)

Count high = SUMX(orders,[Bool high])

I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!

My LinkedIn: https://www.linkedin.com/in/n%C3%A4ttiahov-00001/





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

Proud to be a Super User!




Helpful resources

Announcements
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!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.