Forum Discussion

eag24's avatar
eag24
Frequent Visitor
2 years ago

DAX Filter

Hello,

I am making a Price Volume Mix in PowerBI, but after review I need to fix my values for Total Volume. I have made this PVM Dynamic by allowing the user to select two years. I set those years as Min and Max. My table counts the volume of a product line for the minimum and maximum years selected perfectly fine, but I cant get the total volume of all productlines for each manufacturer of the seleted year. I could be overcomplicating it, but not sure. My first DAX VolumeYearMin for product line looks like this, and displays correct values. 

 

VolumeYearMin =
VAR YearMin =
YEAR(MIN(CalendarTable[Date]))
RETURN
CALCULATE(
SUM(Table1[QUANTITY_SHIPPED]),
Table1[Year] = YearMin
)
 
My second dax where I want to grab all the manufacturer's volume for that product line runs of that yea. Displays the exact value of my first dax. 
SumVolumeMin =
VAR YearMin =
YEAR(MIN(CalendarTable[Date]))
RETURN
CALCULATE(
    SUMX(
        FILTER(
            Table1,
            Table1[MANUFACTURER] = SELECTEDVALUE(Table1[MANUFACTURER]) &&
            YEAR(Table1[INVOICE_DATE]) = YearMin
        ),
        Table1[QUANTITY_SHIPPED]
    )

Any Suggestions? 

1 Reply

  • Hi eag24,

     

    In your second DAX, I have few questions:

    1. You are trying to show the selected manufacturer's volume?

    2. Any reason why you enclosed it within CALCULATE? Did you check the same measure without using CALCULATE?