Click here to Skip to main content
15,887,135 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
for eg in nov 23 for product 3245 having order of 50,

in dec 23 for product 3245 having order of 45

Using Direct Query mode
output:

in jan 24 for product 3245 order should be 50 + 40=90 (nov23 product 3245 order + dec 23 product 3245 order).

It has to go dynamically for feb 24, jan24+dec 23. sample data

Product location monthyear order MonthSeq
3245 abc Nov-23 34 23
3245 abc Oct-23 56 22
5255 xyz Nov-23 45 23
5255 xyz Oct-23 96 22
how to achieve this in power bi. Dont have date column. only monthyear and monthseq. Is it possible to use product + location for uniquenes.

What I have tried:

My Measure = 
  var thisMonth = MAX('YourTable'[MonthSeq])
  return
    CALCULATE(
      SUM('YourTable'[order]),
      ALLEXCEPT('YourTable', 'YourTable'[Product]),
      'YourTable'[MonthSeq] >= thisMonth - 2 && 'YourTable'[MonthSeq] < thisMonth
    )
but getting errror: The resultset of a query to external data source has exceeded the maximum allowed size of '1000000'. using direct query mode.
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900