Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Solved! Go to Solution.
Hi @Anonymous ,
You might consider using the SELECTEDVALUE() function to get the specific product or a specific category:
Opening Stock Previous Month =
VAR LastDateInPrevMonth = [LastDateInPreviousMonth]
VAR SelectProduct=SELECTEDVALUE('TT sellout 2023 to date'[Product])
VAR SelectCategory=SELECTEDVALUE('TT sellout 2023 to date'[category])
RETURN
CALCULATE(
SUM('TT sellout 2023 to date'[Inventory in Cases]),
FILTER(
ALL('TT sellout 2023 to date'),
'TT sellout 2023 to date'[Date] = LastDateInPrevMonth&&
'TT sellout 2023 to date'[Product]=SelectProduct &&
'TT sellout 2023 to date'[category]=SelectCategory
)
)
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
You might consider using the SELECTEDVALUE() function to get the specific product or a specific category:
Opening Stock Previous Month =
VAR LastDateInPrevMonth = [LastDateInPreviousMonth]
VAR SelectProduct=SELECTEDVALUE('TT sellout 2023 to date'[Product])
VAR SelectCategory=SELECTEDVALUE('TT sellout 2023 to date'[category])
RETURN
CALCULATE(
SUM('TT sellout 2023 to date'[Inventory in Cases]),
FILTER(
ALL('TT sellout 2023 to date'),
'TT sellout 2023 to date'[Date] = LastDateInPrevMonth&&
'TT sellout 2023 to date'[Product]=SelectProduct &&
'TT sellout 2023 to date'[category]=SelectCategory
)
)
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thanks for the reply from lbendlin , please allow me to provide another insight:
Hi @Anonymous ,
You can change ALLSELECTED() to All() for that formula:
Opening Stock Previous Month =
VAR LastDateInPrevMonth = [LastDateInPreviousMonth]
RETURN
CALCULATE(
SUM('TT sellout 2023 to date'[Inventory in Cases]),
FILTER(
ALL('TT sellout 2023 to date'),
'TT sellout 2023 to date'[Date] = LastDateInPrevMonth
)
)
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thanks Liu, i had tried that and it works. the issue it that i would like for other slicers to affect it but it doesn't work. for example if i want to view stock for a specific product or a specific category, the slicers do not affect it at all.
Your slicer must be fed from a disconnected table.
User | Count |
---|---|
16 | |
15 | |
14 | |
12 | |
11 |
User | Count |
---|---|
19 | |
15 | |
14 | |
11 | |
9 |