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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
PTSS
Frequent Visitor

how to add formula from visual matrix

currently I have a data concept like this that I insert in the power bi matrix

 

Rows
Project

Account

 

Column

Date

 

Value
AMount

formula.png

 

i want to change the amount from the rain/day account to a formula
fill in the formula  Factor Slippery*Total Hujan

 

what kind of formula should I use, please help

1 ACCEPTED SOLUTION
v-zhangti
Community Support
Community Support

Hi, @PTSS 

 

I restored some data and hope it matches your situation.

Sample data:

vzhangti_0-1669260511703.png

Measure =
VAR _N1 =SUM ( 'Table'[Amount] )
VAR _N2 =
    CALCULATE (SUM ( 'Table'[Amount] ),
        FILTER (ALL ( 'Table' ),
            [Account] = "Factor Slippery"
                && [Date] = SELECTEDVALUE ( 'Table'[Date] )))
VAR _N3 =
    CALCULATE (SUM ( 'Table'[Amount] ),
        FILTER (ALL ( 'Table' ),
            [Account] = "Total Hujan"
                && [Date] = SELECTEDVALUE ( 'Table'[Date] )))
RETURN
    IF ( _N1 = BLANK (), _N2 * _N3, _N1 )

vzhangti_1-1669260544384.png

Is this the result you expect?

Best Regards,

Community Support Team _Charlotte

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
v-zhangti
Community Support
Community Support

Hi, @PTSS 

 

I restored some data and hope it matches your situation.

Sample data:

vzhangti_0-1669260511703.png

Measure =
VAR _N1 =SUM ( 'Table'[Amount] )
VAR _N2 =
    CALCULATE (SUM ( 'Table'[Amount] ),
        FILTER (ALL ( 'Table' ),
            [Account] = "Factor Slippery"
                && [Date] = SELECTEDVALUE ( 'Table'[Date] )))
VAR _N3 =
    CALCULATE (SUM ( 'Table'[Amount] ),
        FILTER (ALL ( 'Table' ),
            [Account] = "Total Hujan"
                && [Date] = SELECTEDVALUE ( 'Table'[Date] )))
RETURN
    IF ( _N1 = BLANK (), _N2 * _N3, _N1 )

vzhangti_1-1669260544384.png

Is this the result you expect?

Best Regards,

Community Support Team _Charlotte

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

Hi @v-zhangti 

PTSS_0-1669698074600.png

 


Please help me.
I want to add formula in capex = slippery/100. how to if add 2 conditions in amount?

amazing solution...

Screenshot_13.png

 

but can you help me again, how do you do it if the capex account value is not the same as slippery because the capex value is also 0.
and I want to add a formula in capex from slippery/100

thankyou

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.