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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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

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 as solution to help other members find it more quickly.

View solution in original post

4 REPLIES 4
v-shex-msft
Community Support
Community Support

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 as solution to help other members find it more quickly.

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

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 as solution to help other members find it more quickly.

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.