Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.
Sharing : link for PBIX and EXCEL files
https://drive.google.com/file/d/14SBMji1NqkCwShszz8Ap6Fi5g3ACpbAi/view?usp=sharing - PBIX
https://drive.google.com/file/d/1-ZjTkywhMso1UpEnlkzkWbrvaX2eWpj_/view?usp=sharing - EXCEL
Solved! Go to Solution.
Hi @TiwariNeha ,
Based on your description, Please create a sort measure first.
RANK =
RANKX (
FILTER ( ALLSELECTED ( Master ), Master[product id] = SELECTEDVALUE ( Master[product id] ) ),
CALCULATE ( SELECTEDVALUE (Master[Snap_date]) ),
,
DESC,
DENSE
)
Measure = CALCULATE(SUM(Master[(Sales_order_history)]),FILTER(ALLSELECTED(Master),[RANK]=1))
Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Nathaniel_C Nathaniel,
Thanks for your reply. The output that is coming from the suggested calculation is different from the expected solution.
Let me explain , if we dont take the sanpdate 06/22/2020, then for period date 06/01/2020, Sum should be 1300 for product id 9 and 10 as there are no duplicates for that particular dates.
Thanks & Regards:
Neha
Hi @TiwariNeha ,
Based on your description, Please create a sort measure first.
RANK =
RANKX (
FILTER ( ALLSELECTED ( Master ), Master[product id] = SELECTEDVALUE ( Master[product id] ) ),
CALCULATE ( SELECTEDVALUE (Master[Snap_date]) ),
,
DESC,
DENSE
)
Measure = CALCULATE(SUM(Master[(Sales_order_history)]),FILTER(ALLSELECTED(Master),[RANK]=1))
Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @TiwariNeha , Not sure if I understand what you want, however try this:
Sum of Sales =
VAR _curSnapDate =
MAX ( Master[Snap_date] )
VAR _curProductID =
MAX ( Master[product id] )
VAR _curCustomerID =
MAX ( Master[customer id] )
VAR _calc =
CALCULATE (
MAX ( Master[(Sales_order_history)] ),
FILTER (
ALL ( Master ),
Master[customer id] = _curCustomerID
&& Master[product id] = _curProductID
&& Master[Snap_date] = MAX ( Master[Snap_date] )
)
)
VAR _maxDate =
CALCULATE (
MAX ( Master[Snap_date] ),
FILTER (
ALL ( Master ),
Master[customer id] = _curCustomerID
&& Master[product id] = _curProductID
)
)
RETURN
IF ( _maxDate = _curSnapDate, _calc )
Let me know if you have any questions.
If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos 👍are nice too.
Nathaniel
Proud to be a Super User!
Check out the November 2023 Power BI update to learn about new features.
Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.