Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Soldexio
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
Anonymous
Not applicable

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

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

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

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

Anonymous
Not applicable

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

Hi @Anonymous

 

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
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors