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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
Anonymous
Not applicable

Minimum across column

Hi all,

 

I have a table in visualization as below:

 

CustomerSalesQuantityAvg SalesDiscountNet SalesSales catQuantity catNet Sales catCustomer category
A4000202001539850100
B300056001029901311
C1000254059952020
D500105014993232

 

*Net Sales = Sales - Discount (Discount is from other table)

Sales cat, Quantity cat and Net Sales cat are based from Sales, Quantity and Net Sales value.

What I want is to get the Customer category. Customer category is based on the minimum among Sales cat, Quantity cat and Net Sales cat.

1 ACCEPTED SOLUTION

@Anonymous

 

Try this

 

Customer Category =
MIN (
    MIN ( SELECTEDVALUE ( [Quantity Cat] ), SELECTEDVALUE ( [Sales Cat] ) ),
    [Net Sales Cat]
)

Regards
Zubair

Please try my custom visuals

View solution in original post

7 REPLIES 7
Zubair_Muhammad
Community Champion
Community Champion

@Anonymous

 

What if you use Min Function as Measure

 

 

Customer Category =
MIN ( [Quantity Cat], [Sales Cat] )

Regards
Zubair

Please try my custom visuals
Anonymous
Not applicable

Sorry, @Zubair_Muhammad I have left out one more element, which customer category is based on the minimum of sales cat, quantity cat and net sales cat.

 

I have tried the MIN in measure. But I have an error message 'A single value for column 'net sales cat' in table A cannot be determined.

 

@Anonymous

 

Are  " sales cat, quantity cat and net sales cat"  measures or calculated columns?

 

MIN allows only 2 arguments..so you can wrap a MIN function inside another MIN

 

Customer Category = MIN(MIN([Quantity Cat],[Sales Cat]),[Net Sales Cat])

See the attached sample file


Regards
Zubair

Please try my custom visuals
Anonymous
Not applicable

@Zubair_Muhammad,

 

I can't do that because sales cat, quantity cat and net sales cat are from different table.

Anonymous
Not applicable

@Zubair_Muhammadsales cat and quantity cat are new column while net sales cat is new measure.

@Anonymous

 

Try this

 

Customer Category =
MIN (
    MIN ( SELECTEDVALUE ( [Quantity Cat] ), SELECTEDVALUE ( [Sales Cat] ) ),
    [Net Sales Cat]
)

Regards
Zubair

Please try my custom visuals
Anonymous
Not applicable

@Zubair_Muhammad

Got it, Thanks

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

AugPowerBI_Carousel

Power BI Monthly Update - August 2024

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

August Carousel

Fabric Community Update - August 2024

Find out what's new and trending in the Fabric Community.