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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
NicoleHecht
Frequent Visitor

DAX Measure with Nested IF Statements

Dear community,

I would like to create a table per article where I calculate it's price, depending on the quantity that gets ordered.

 

To explain it in a easier way:

If the quantity that is ordered per bill is >= 10, I do fill the measure S1 with "1".

If the quantity that is ordered per bill is >= 20, I do fill the measure S2 with "1".

Accordingly the twp fields S1 and S2 have different discounts (e.g. 5% and 10%)

 

Net Price = if([S2]>=1 ;([Gross_Price]*(0.9));if([S1]>=1;([Gross_Price]*(0.95));
[Gross_price])

 

My measure works fine, when I do show in the table the article AND the bills (row by row).

I even managed to get the table total line correct with the following formula:

AVERAGEX(
 KEEPFILTERS(VALUES(Table[BILLINGS]));
 CALCULATE([Net_Price])
)

 

My problem starts if I want to show the data only per article (leave out the billing dimension).

My measure then does not calculate row by row on the level of the bills.

 

How can I adjust my Net_price measure with the if conditions so that it calculates on level of the bills?


Thanks for your help.

 

Nicole

 

 

1 REPLY 1
v-chuncz-msft
Community Support
Community Support

@NicoleHecht,

 

A simplified example would be better. You may also check http://community.powerbi.com/t5/Desktop/Change-table-visualization-total/m-p/323290#M144103.

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors
Top Kudoed Authors