Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
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 )
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
This is the output I am getting.
Here is a snapshot of the model:
User | Count |
---|---|
21 | |
14 | |
11 | |
8 | |
5 |
User | Count |
---|---|
24 | |
22 | |
20 | |
15 | |
10 |