Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi,
I need help calculating the price difference between pack sizes of the same SKU. Below is the sample output I received:
The values in Price difference are partially correct. There is no discrepancies in data.
Below is the measure I tried to get this output:
Hi,
I am not sure how the semantic model looks like, but please try something like below if it suits your requirement.
CIA PriceDifference =
VAR CRSellUnit =
MIN ( 'PRODUCT'[SELL_UNIT] )
VAR CRPrice_IV = [CIA Price Per Unit]
VAR PRSellUnit =
MAXX (
FILTER ( ALL ( 'PRODUCT'[SELL_UNIT] ), 'PRODUCT'[SELL_UNIT] < CRSellUnit ),
'PRODUCT'[SELL_UNIT]
)
VAR PRPrice_FV =
CALCULATE ( [CIA Price Per Unit], 'PRODUCT'[SELL_UNIT] = PRSellUnit )
RETURN
IF ( ISBLANK ( PRPrice_FV ), BLANK (), PRPrice_FV - CRPrice_IV )
This is the output I am getting.
Here is a snapshot of the model:
Check out the July 2025 Power BI update to learn about new features.
User | Count |
---|---|
22 | |
7 | |
6 | |
6 | |
6 |
User | Count |
---|---|
27 | |
12 | |
10 | |
9 | |
6 |