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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
reynold522
Helper II
Helper II

a measure or column calculated base on multiple condition

Hi all, 

 

I have a table like following

 

Battery Type SetupCapacityThreshold Capacity
1110080%*Capacity
217030%*Capacity
3110010%*capacity
1270200%*capacity
22100120%*capacity

 

the column 1-3 are already exist, the forth column is the one that I would like to implement

the value calculated in forth coloumn will be depended on column 1-3, if condition.

 

what will be DAX code for this case?

I would like to use threshold to set alert, is column or measure better for this case?

 

Thanks in advance

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @reynold522 ,

 

I suggest you to create a 'Threshold' table and then calculate based on it.

RicoZhou_0-1672215363325.png

Create a calculated column in your capacity table.

Threshold Capacity = 
VAR _Threshold =
    CALCULATE (
        SUM ( Threshold[Threshold] ),
        FILTER (
            Threshold,
            Threshold[Battery Type ] = EARLIER ( 'Table'[Battery Type ] )
                && Threshold[Setup] = EARLIER ( 'Table'[Setup] )
        )
    )
RETURN
    'Table'[Capacity] * _Threshold

 Result is as below.

RicoZhou_1-1672215427147.png

Best Regards,
Rico Zhou

 

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

3 REPLIES 3
FreemanZ
Super User
Super User

hi @reynold522 

 

the pattern is not that obvious. could you explain the logic behind?

Yeah, the threshold (unit capacity) is heavily depend on battery nominal capacity and type of battery as well as battery setup.  

 

e.g., 1st row, if battery type is 1, setup is 1 and capacity is 100, then threshold according to our experimental results should set as 80%*capacity, in this row, capacity is 100, then the value should be 80

Anonymous
Not applicable

Hi @reynold522 ,

 

I suggest you to create a 'Threshold' table and then calculate based on it.

RicoZhou_0-1672215363325.png

Create a calculated column in your capacity table.

Threshold Capacity = 
VAR _Threshold =
    CALCULATE (
        SUM ( Threshold[Threshold] ),
        FILTER (
            Threshold,
            Threshold[Battery Type ] = EARLIER ( 'Table'[Battery Type ] )
                && Threshold[Setup] = EARLIER ( 'Table'[Setup] )
        )
    )
RETURN
    'Table'[Capacity] * _Threshold

 Result is as below.

RicoZhou_1-1672215427147.png

Best Regards,
Rico Zhou

 

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

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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