cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper I
Helper I

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:

Sale s/he/he/he
CALCULATE(
[TOTAL_SO_UNIDADES],
DATESBETWEEN(SELLOUT[Dates],
DATEADD(LASTDATE(SELLOUT[Fechas]),-13,DAY),
LASTDATE(SELLOUT[Dates])
))
The question is, how can I create that column as a result of that measure? I've tried, but it throws error.



I'm staying tuned

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User IV
Super User IV

Re: Create a column based on a measure

@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.



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

View solution in original post

3 REPLIES 3
Highlighted
Super User IV
Super User IV

Re: Create a column based on a measure

@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.



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

View solution in original post

Highlighted
Super User III
Super User III

Re: Create a column based on a measure

Hi,

Share some data, describe the question and show the expected result.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Highlighted
Helper I
Helper I

Re: Create a column based on a measure

SO 14D = SUMX(RELATEDTABLE(SELLOUT), DATESBETWEEN(SELLOUT[Fechas], DATEADD(LASTDATE(SELLOUT[Fechas]),-13,DAY), LASTDATE(SELLOUT[Fechas])))

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Community Conference

Microsoft Power Platform Communities

Check out the Winners!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Top Solution Authors
Top Kudoed Authors
Users online (868)