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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
tyan
Helper II
Helper II

How to set up multi condition and then calculate the value

tyan_0-1639495210015.png

 

Hi. Thank you for helping me! I am a beginner still learning how to do powerbi...

so i have a database somthing like the table above.   I would like to calculate quanity % and price % by brand and department level.  The thing is I have to spill them by three conditions, >=100%,  between 99% ~ 70%, and less than 70%

 

The result I would like to show is provided in below table... I use NIKE as my example...  ( quanity %)

In my powerbi modeing, I have created a now column indicated which one is >=100%,  between 99% ~ 70%, and less than 70% this three condition.  But im still lost.. just dont show the below number that im looking for..

 

 

Someone please help~ 

tyan_1-1639495274860.png

 

1 ACCEPTED SOLUTION
Icey
Community Support
Community Support

Hi @tyan ,

 

Please check if this is what you want:

Icey_0-1640151945354.png

 

Steps:

1. Enter data to create a Group table.

Icey_0-1640153136958.png

 

 

2. Create measures.

Quantity Measure 1 = 
SWITCH (
    MAX ( 'Group'[Order] ),
    1,
        CALCULATE (
            SUM ( 'Table'[Quantity] ),
            FILTER ( 'Table', 'Table'[Forecast vs Color] >= 1 )
        ),
    2,
        CALCULATE (
            SUM ( 'Table'[Quantity] ),
            FILTER (
                'Table',
                'Table'[Forecast vs Color] >= 0.7
                    && 'Table'[Forecast vs Color] <= 0.9
            )
        ),
    3,
        CALCULATE (
            SUM ( 'Table'[Quantity] ),
            FILTER ( 'Table', 'Table'[Forecast vs Color] < 0.7 )
        )
)
Quantity Measure 2 = 
SUMX ( VALUES ( 'Group'[Group] ), [Quantity Measure 1] )

 

3. Create Matrix visuals.

Icey_1-1640153205785.png

Icey_2-1640153244243.png

 

 

 

Best Regards,

Icey

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Icey
Community Support
Community Support

Hi @tyan ,

 

Please check if this is what you want:

Icey_0-1640151945354.png

 

Steps:

1. Enter data to create a Group table.

Icey_0-1640153136958.png

 

 

2. Create measures.

Quantity Measure 1 = 
SWITCH (
    MAX ( 'Group'[Order] ),
    1,
        CALCULATE (
            SUM ( 'Table'[Quantity] ),
            FILTER ( 'Table', 'Table'[Forecast vs Color] >= 1 )
        ),
    2,
        CALCULATE (
            SUM ( 'Table'[Quantity] ),
            FILTER (
                'Table',
                'Table'[Forecast vs Color] >= 0.7
                    && 'Table'[Forecast vs Color] <= 0.9
            )
        ),
    3,
        CALCULATE (
            SUM ( 'Table'[Quantity] ),
            FILTER ( 'Table', 'Table'[Forecast vs Color] < 0.7 )
        )
)
Quantity Measure 2 = 
SUMX ( VALUES ( 'Group'[Group] ), [Quantity Measure 1] )

 

3. Create Matrix visuals.

Icey_1-1640153205785.png

Icey_2-1640153244243.png

 

 

 

Best Regards,

Icey

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@tyan , if you have already created a column with these values then you can use that in the matrix column to pivot the data. You can use count in values ?

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
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

Top Solution Authors
Top Kudoed Authors