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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
jopezzo
Helper I
Helper I

How to calculate a turnover with the first price found in a table?

Hi! I am trying to calculate a turnover not based on the price that appears on each row of my fact table, but based on the first price found.

 

Example:

 

MonthQuantityPriceTurnover
1145         1,187             172,115
2149         1,187             176,863
3182         1,187             216,034
4155         1,187             183,985
5111         1,187             131,757
6128         1,187             151,936
7105         1,187             124,635
8142         1,187             168,554
9118         1,163             137,234
10162         1,163             188,406
11175         1,163             203,525
12155         1,163             180,265
            2,035,309

 

For the turnover, I would have something like:

 

Turnover =
SUMX(fact_Volumes,fact_Volumes[Price]*fact_Volumes[Quantity])
 
What I would like is a measure to calculate the turnover with the actual quantity and the first price appearing in the table. In this example I would have all the quantities multiplied by the price 1,187.
 
Any idea?
1 ACCEPTED SOLUTION

Thanks for the data.

I changed the formula to take different Material into account.

Create a column

EarlyPrice Revenue = VAR _CurrMaterial = FactPrices[Material] 
  RETURN
   FactPrices[Quantity] * CALCULATE(SUM(FactPrices[Price]) , 
                                    FILTER(FactPrices, 
                                            FactPrices[Material] = _CurrMaterial && 
                                            FactPrices[DateKey] = MIN(FactPrices[DateKey])
                                            )
   )

View solution in original post

10 REPLIES 10

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors