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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Anonymous
Not applicable

calculated measure based on column value

Hi, I'm a DAX newbie and I would like a calculated measure to change based on column value of Account. For example, if the "Account" number = 10002, then it should muliple the cost by the "Rate" and "VAT" and the rates it should change based on the "Account" number. I will be supplying the rates manually in the forumla so the additional "Rate" and "VAT" columns are of elaboration purposes. I tried something like below since I want this to have the same forumla for all accounts except for account 10002. Thank you all in advance!

 

AnnualTax =
VAR RateCalc =CALCULATE(SUMX(Table, Cost[Sum of Cost])

Return

CALCULATE(
    (RateCalc*0.1836),

)

 

 

AccountRateVATCostCalculated Measure
1000118%6%$1,000.00$                    1,000.00
1000219%17%$2,000.00=[Cost]*(1+[VAT])*[Rate]
1000320%20%$3,000.00$                    3,000.00

 

3 REPLIES 3
Anonymous
Not applicable

Have you tried with an IF sentece?

This is like:

AnnualTax =
VAR RateCalc =CALCULATE(SUMX(Table, Cost[Sum of Cost])

Return

    IF(Table[Account]="10002"]; RateCalc*(1+[VAT])*Rate; RateCalc)

)

Anonymous
Not applicable

Try using a calculated column instead using variable then. (I'm newbie too ^^)

This is: write a measure to calculate RateCalc

     RateCalc := CALCULATE(SUMX(Table, Cost[Sum of Cost]))

Then, in a new column, use IF(Table[Account]="10002"]; RateCalc*(1+[VAT])*Rate; RateCalc)

 

 

Anonymous
Not applicable

yes I have. For some reason, the measure does not recognize the table/columns whe you type an IF statement after the VAR returns.

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.