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 guys,
I am currently trying to figure out the following: how would my revenue change if customer A got the prices customer B has?
Please find the file here: https://www.dropbox.com/sh/2vxnjdgt8vk0pxs/AABo2Mv3XMw9Mz-ujIUYrqSFa?dl=0
I want this comparison to be dynamic, i. e. I set up two slicers to select the two customers I want to compare. My input table is a transaction table.
In the example of the screenshot, I compare Customer "123" with customer "456". They have the products "ABC", "DEF", "GHI", and "JKL" in common. How would the revenue of customer "123" change if they get the (average) prices customer "456" gets? Since customer "456" does not purchase product "MNO", I would like to assume the price stays stable for customer "123" for product "MNO", i.e. 45,30 €. Since product "DEF" is purchased twice by customer "456", I assume the weighted average to be customer "123"'s price, i.e 11,70 €.
Revenue customer A with own prices: 3929 €
Revenue customer A with "456" prices: 3890 €
Target measure: -0,99 % = (3890 - 3929) / 3929
Any ideas?
Thanks very much!
Best
Tom
Solved! Go to Solution.
Here's a way to calculate the alternative revenue:
Customer 1 Alt Revenue =
VAR Cust1 = SELECTEDVALUE ( CustomerSelection1[CustomerID] )
VAR Cust2 = SELECTEDVALUE ( CustomerSelection2[CustomerID] )
VAR Products1 = CALCULATETABLE ( VALUES ( SalesData[ProductID] ), SalesData[CustomerID] = Cust1 )
VAR Products2 = CALCULATETABLE ( VALUES ( SalesData[ProductID] ), SalesData[CustomerID] = Cust2 )
VAR SharedProductsRev =
ADDCOLUMNS (
INTERSECT ( Products1, Products2 ),
"@Qty", CALCULATE ( SUM ( SalesData[Quantity] ), SalesData[CustomerID] = Cust1 ),
"@Price", CALCULATE ( [AveragePrice], SalesData[CustomerID] = Cust2 )
)
VAR Cust1OnlyProductsRev =
ADDCOLUMNS (
EXCEPT ( Products1, Products2 ),
"@Qty", CALCULATE ( SUM ( SalesData[Quantity] ), SalesData[CustomerID] = Cust1 ),
"@Price", CALCULATE ( [AveragePrice], SalesData[CustomerID] = Cust1 )
)
RETURN
SUMX ( SharedProductsRev, [@Qty] * [@Price] )
+ SUMX ( Cust1OnlyProductsRev, [@Qty] * [@Price] )
From here, defining the Target measure should be straightforward.
Tricky game of playing with filters,
Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! |
DAX is simple, but NOT EASY! |
Tricky game of playing with filters,
Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! |
DAX is simple, but NOT EASY! |
Tricky game of playing with filters,
Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! |
DAX is simple, but NOT EASY! |
Tricky game of playing with filters,
Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! |
DAX is simple, but NOT EASY! |
Here's a way to calculate the alternative revenue:
Customer 1 Alt Revenue =
VAR Cust1 = SELECTEDVALUE ( CustomerSelection1[CustomerID] )
VAR Cust2 = SELECTEDVALUE ( CustomerSelection2[CustomerID] )
VAR Products1 = CALCULATETABLE ( VALUES ( SalesData[ProductID] ), SalesData[CustomerID] = Cust1 )
VAR Products2 = CALCULATETABLE ( VALUES ( SalesData[ProductID] ), SalesData[CustomerID] = Cust2 )
VAR SharedProductsRev =
ADDCOLUMNS (
INTERSECT ( Products1, Products2 ),
"@Qty", CALCULATE ( SUM ( SalesData[Quantity] ), SalesData[CustomerID] = Cust1 ),
"@Price", CALCULATE ( [AveragePrice], SalesData[CustomerID] = Cust2 )
)
VAR Cust1OnlyProductsRev =
ADDCOLUMNS (
EXCEPT ( Products1, Products2 ),
"@Qty", CALCULATE ( SUM ( SalesData[Quantity] ), SalesData[CustomerID] = Cust1 ),
"@Price", CALCULATE ( [AveragePrice], SalesData[CustomerID] = Cust1 )
)
RETURN
SUMX ( SharedProductsRev, [@Qty] * [@Price] )
+ SUMX ( Cust1OnlyProductsRev, [@Qty] * [@Price] )
From here, defining the Target measure should be straightforward.
User | Count |
---|---|
116 | |
73 | |
60 | |
48 | |
48 |
User | Count |
---|---|
171 | |
122 | |
60 | |
59 | |
56 |