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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
JetMax
Frequent Visitor

Measure Help

Hi All!

 

I need some help with a Measure I am trying to do. I want to do the below which is working out the cost of something based on 3 separate critrea - Brand, Country and Type and work out the different combinations. I tried an IF or calculate but the problem is it is over two different datasets.

 

Dateset 1

Calculate(Sum(Total),filter(Description))

 

Dataset 2

Brand = Opt 1 or Opt 2

Country = Opt 1 or Opt 2

Type = Opt 1 or Opt 2

 

example-

(Calculate(Sum(Total),filter(Description))

*

if(Brand=Opt 1 and Country=Opt 1 and Type = Opt 1) 

or if(Brand=Opt 1 and Country=Opt 2 and Type = Opt 2) 

or if(Brand=Opt 1 and Country=Opt 1 and Type = Opt 2) 

or if(Brand=Opt 1 and Country=Opt 2 and Type = Opt 1) 

or if(Brand=Opt 2 and Country=Opt 1 and Type = Opt 1) 

or if(Brand=Opt 2 and Country=Opt 2 and Type = Opt 2) 

or if(Brand=Opt 2 and Country=Opt 1 and Type = Opt 2) 

or if(Brand=Opt 2 and Country=Opt 2 and Type = Opt 1) 

1 ACCEPTED SOLUTION

My Mistake

SWITCH(true(),
firstnonbank(table[Brand],blank())="Opt 1" &&  firstnonbank(table[Country],blank())="Opt 1" && firstnonbank(table[Type],blank()) = "Opt 1","A1",
firstnonbank(table[Brand],blank())="Opt 1" &&  firstnonbank(table[Country],blank())="Opt 2" && firstnonbank(table[Type],blank()) = "Opt ","A3",
"A4"
)
Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

Try Like

SWITCH(true(),
firstnonbank(table[Brand])="Opt 1" &&  firstnonbank(table[Country])="Opt 1" && firstnonbank(table[Type]) = "Opt 1","A1",
firstnonbank(table[Brand])="Opt 1" &&  firstnonbank(table[Country])="Opt 2" && firstnonbank(table[Type]) = "Opt ","A3",
"A4"
)

 

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution.
In case it does not help, please provide additional information and mark me with @

Thanks. My Recent Blogs -Decoding Direct Query - Time Intelligence, Winner Coloring on MAP, HR Analytics, Power BI Working with Non-Standard TimeAnd Comparing Data Across Date Ranges
Proud to be a Datanaut Connect on Linkedin

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hi @amitchandak 

 

Thanks for the reply, I have tried this but I get this error - "Too few arguments were passed to the FIRSTNONBLANK function. The minimum argument count for the function is 2.". Have I entered somehing incorrectly?

My Mistake

SWITCH(true(),
firstnonbank(table[Brand],blank())="Opt 1" &&  firstnonbank(table[Country],blank())="Opt 1" && firstnonbank(table[Type],blank()) = "Opt 1","A1",
firstnonbank(table[Brand],blank())="Opt 1" &&  firstnonbank(table[Country],blank())="Opt 2" && firstnonbank(table[Type],blank()) = "Opt ","A3",
"A4"
)
Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.