Forum Discussion
Create a column based on a measure
Dear
I need to create the following column "instock ? If ( Stock > ? (Sell/14), 1, 0)"
The problem is that the stock is ready in Table 1, but the sale is made based on a measure in Table 2, which is as follows:
I'm staying tuned
csalinas23 ,Not very clear.
You can have a new column in the stock table like
Sumx(filter(Sales,[sales[item id] = stock[item Id] && Sales[Date] >= max(sales[date])-13),sales[TOTAL_SO_UNIDADES])
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.
3 Replies
- amitchandak
Super User
csalinas23 ,Not very clear.
You can have a new column in the stock table like
Sumx(filter(Sales,[sales[item id] = stock[item Id] && Sales[Date] >= max(sales[date])-13),sales[TOTAL_SO_UNIDADES])
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.
- Ashish_Mathur
Super User
Hi,
Share some data, describe the question and show the expected result.
- csalinas23
Helper II
SO 14D = SUMX(RELATEDTABLE(SELLOUT), DATESBETWEEN(SELLOUT[Fechas], DATEADD(LASTDATE(SELLOUT[Fechas]),-13,DAY), LASTDATE(SELLOUT[Fechas])))