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

Flag row as used

Hey there,

 

I have a situation I have not been able to tackle without multiple merges and complicated solutions, which I believe can be done easier. Lets say I have the following example INVENTORY_DATA:

 

Article      Date              Inventory

1             28-01-2018    2

2             28-01-2018    3

3             28-01-2018    5

1             05-02-2018    3

 

Now I have the following sales table called SALES_DATA:

 

Article      Selling Date    Amount

1             28-01-2018     1

1             06-02-2018     2

1             07-02-2018     1

 

How can I "flag" the sales to only allow the first 2 sales to be allocated to the table, the option to group the table is not possible due to the differences in the dates. A sale has to occur within 14 days from the inventory moment, otherwise it cannot be allocated to the respective sale. The hard part is that for example the second row of the sales file, one sale needs to be allocated to the first inventory, one to the second one. How can this easily be solved in Power BI? Or is this logic that needs to be moved to python/R in order to calculate it there, export it to CSV and import it to power bi for visualisations?

 

I hope the info suffices, otherwise please tell what you are missing.

 

Kind regards

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Flag row as used

HI @Soldexio,

 

Based on test, you formula need  to do some Recursive calculation which power bi not support, so I'd like to suggest you calculate out of power bi and import result table to create visualization.

 

Current steps: need one more condition to loop through previous calculated to ensure current amount not calculated in previous.

 

9.PNG

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
Highlighted
Community Support
Community Support

Re: Flag row as used

Hi @Soldexio,


Can you please provide some sample data or pbix file for test? It will be help to clarify your table structure and coding formula.


Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
Helper I
Helper I

Re: Flag row as used

Hey there,

 

In the first post I have given some sample data to clarify my table structure and coding formula. The situation is that I have 2 tables with a few colums. Is that not enough?

 

Kind regards,

 

Dennis

Highlighted
Community Support
Community Support

Re: Flag row as used

HI @Soldexio,

 

Based on test, you formula need  to do some Recursive calculation which power bi not support, so I'd like to suggest you calculate out of power bi and import result table to create visualization.

 

Current steps: need one more condition to loop through previous calculated to ensure current amount not calculated in previous.

 

9.PNG

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Highlighted
Helper I
Helper I

Re: Flag row as used

Hi @v-shex-msft

 

Thanks for the attempt, I came to the same conclusion and just wanted to make sure there was no trick underwater that could help me.

 

Kind regards,

 

Soldexio

Helpful resources

Announcements
Community Blog

Community Blog

Visit our Community Blog for articles, guides, and information created by fellow community members.

Using the Community

Using the Community

Need help with the Power BI Community? Our 'Using the Community' support articles are a great place to start.

Galleries

Galleries

Looking for inspiration on how to present your data? Need instructional videos? Check out our Galleries!

Community Summit North America

Community Summit North America

Innovate, Collaborate, Grow. The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors