Forum Discussion

Cr7vc's avatar
Cr7vc
New Member
3 years ago

Need help on dax query

Hi Team,

 

I have two filters one is of date (between is used to selected dates between intervals) and other one is month.

My data contains column such as category, dealer name, opening stock, closing stock,date.

For opening stock the logic is if a date is selected example 1st Aug to 6th aug then opening stock will be the last date value of previous month .this is working correctly.

Using opening stock = calculate(sum(opening stock), lastdate(previous month(date)))

However when month filter is selected and as now with the above date selection it will be show only one value i.e aug and if select all is unchecked and only aug is selected then opening stock measure goes blank

I tried modification in the logic of opening stock using 

Opening stock = if (isfiltered(month),

calculate(sum(opening stock), lastdate(previous month(date))),

calculate(sum(opening stock), lastdate(previous month(date))))

 But still the measure goes blank when only one month is selected. Please help.

 

 

1 Reply

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Cr7vc ,

    In order to better understand your demands and give the right solution, could you please provide some more specific information? such as your desensitized example data and a screenshot of your desired results?

    Thanks for your efforts & time in advance.

     

    Best regards,
    Community Support Team_Binbin Yu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.