Forum Discussion
Michael_nik
3 years agoRegular Visitor
Making a pivot table
Hi everyone! I'm new in power bi, but I have a strong basis in Pyton. I was given a simple task to make a table from sample one which is given in Power BI by default. So the task is to calculate ...
- 3 years ago
Use this measure:
Gross Sales by min Sale Price = VAR _minPrice = MIN ( financials[Sale Price] ) VAR _MinPriceAll = CALCULATE ( MIN ( financials[Sale Price] ), ALL ( 'Product Table' ) ) RETURN CALCULATE ( SUM ( financials[Gross Sales] ), FILTER ( 'Product Table', _minPrice = _MinPriceAll ) )
Michael_nik
3 years agoRegular Visitor
I was expecting to get something like this, but to have table that contains only price = 7 you need to add filter which is irrational and affects another data on the wallpaper 😞
I can also take first N rows that have 7 in the second column but it's shady too...
PaulDBrown
3 years agoCommunity Champion
Use this measure:
Gross Sales by min Sale Price =
VAR _minPrice =
MIN ( financials[Sale Price] )
VAR _MinPriceAll =
CALCULATE ( MIN ( financials[Sale Price] ), ALL ( 'Product Table' ) )
RETURN
CALCULATE (
SUM ( financials[Gross Sales] ),
FILTER ( 'Product Table', _minPrice = _MinPriceAll )
)
- Michael_nik3 years agoRegular Visitor
You are amazing! That's exactly what I wanted!