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
Peter_Ronaldon
Frequent Visitor

Need Help - PowerBI Measure

Hi,

 

I have the following PowerBI Measure:

 

Price Impact =
VAR LY_Sales = ([EXTENDED PRICE SPLY])
VAR CY_Sales = ([Extended Price CY])
VAR LY_Quantity = [BASE QUANTITY SPLY]
VAR CY_Quantity = ([Base Quantity CY])
VAR LY_Price_Per_Unit = [LY_Price_Per_Unit]
VAR CY_Price_Per_Unit = [CY_Price_Per_Unit]

RETURN
IF(
ISBLANK(LY_Sales) && ISBLANK(CY_Sales),
0,
IF(
ISBLANK(LY_Sales) || LY_Quantity = 0,
IF(
NOT ISBLANK(CY_Price_Per_Unit),
CY_Price_Per_Unit * LY_Quantity,
0
),
IF(
ISBLANK(CY_Sales) || CY_Quantity = 0,
IF(
NOT ISBLANK(LY_Price_Per_Unit),
LY_Price_Per_Unit * LY_Quantity,
0
),
(CY_Price_Per_Unit - LY_Price_Per_Unit) * LY_Quantity
)
)
)
 
This returns the following for Price Impact:

Peter_Ronaldon_0-1722920859888.png

 

 

I am trying to have it so that if, say Base Quantity CY is blank, then the Price Impact is 0 or blank.

 

The above formula essentially needs to show me: if Quantity LY exists and Quantity CY exists, what is the difference between Price LY and Price CY.

 

Can somebody please help me adjust my formula?

 

Thank you ❤️

 

Thank you! 

 

1 ACCEPTED SOLUTION
bhanu_gautam
Super User
Super User

@Peter_Ronaldon , Try updated measure

 

Price Impact =
VAR LY_Sales = [EXTENDED PRICE SPLY]
VAR CY_Sales = [Extended Price CY]
VAR LY_Quantity = [BASE QUANTITY SPLY]
VAR CY_Quantity = [Base Quantity CY]
VAR LY_Price_Per_Unit = [LY_Price_Per_Unit]
VAR CY_Price_Per_Unit = [CY_Price_Per_Unit]

RETURN
IF(
ISBLANK(CY_Quantity),
0,
IF(
ISBLANK(LY_Sales) && ISBLANK(CY_Sales),
0,
IF(
ISBLANK(LY_Sales) || LY_Quantity = 0,
IF(
NOT ISBLANK(CY_Price_Per_Unit),
CY_Price_Per_Unit * LY_Quantity,
0
),
IF(
ISBLANK(CY_Sales) || CY_Quantity = 0,
IF(
NOT ISBLANK(LY_Price_Per_Unit),
LY_Price_Per_Unit * LY_Quantity,
0
),
(CY_Price_Per_Unit - LY_Price_Per_Unit) * LY_Quantity
)
)
)
)




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






View solution in original post

2 REPLIES 2
Peter_Ronaldon
Frequent Visitor

Firstly, I appreciate the help,

 

Is there a way that I can stop all of these blank rows showing up when I add this Price Impact Measure?

 

For instance, there are no sales (PY or CY) and no Quantity (PY or CY), however, a line is still added with this Price Impact Measure returning a value of $0. Is there a way to stop this from happening without simply filtering out blank rows in say column PY Quantity on the visual itself?

 

Thank you! 😄

 

Peter_Ronaldon_0-1722953672234.png

 

bhanu_gautam
Super User
Super User

@Peter_Ronaldon , Try updated measure

 

Price Impact =
VAR LY_Sales = [EXTENDED PRICE SPLY]
VAR CY_Sales = [Extended Price CY]
VAR LY_Quantity = [BASE QUANTITY SPLY]
VAR CY_Quantity = [Base Quantity CY]
VAR LY_Price_Per_Unit = [LY_Price_Per_Unit]
VAR CY_Price_Per_Unit = [CY_Price_Per_Unit]

RETURN
IF(
ISBLANK(CY_Quantity),
0,
IF(
ISBLANK(LY_Sales) && ISBLANK(CY_Sales),
0,
IF(
ISBLANK(LY_Sales) || LY_Quantity = 0,
IF(
NOT ISBLANK(CY_Price_Per_Unit),
CY_Price_Per_Unit * LY_Quantity,
0
),
IF(
ISBLANK(CY_Sales) || CY_Quantity = 0,
IF(
NOT ISBLANK(LY_Price_Per_Unit),
LY_Price_Per_Unit * LY_Quantity,
0
),
(CY_Price_Per_Unit - LY_Price_Per_Unit) * LY_Quantity
)
)
)
)




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






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!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.