Forum Discussion
Price Increase Decrease Flag earliest date
Hi good day!
Yesterday (with help) I created this formula for a Price Increase Flag for my report
The issue is that the _MinDate that I expect as a result is the one before the first false result, as marked in the pic.
The condition will be IF for the latest date the ANY_PRICE_INC = TRUE, THEN return the ASP for the Min date before the first FALSE.
Not the last or first TRUE in the column, but the first of the consecutive TRUE values only when the most recent is TRUE.
I posted a sample of the data in the table below, the column flag has the result I expect.
Is there a way to do this?
thanks in advance!
| DATE | ASP | ANY_PRICE_DEC | ANY_PRICE_INC | Flag |
| 8/26/2023 0:00 | $49.23 | FALSE | TRUE | |
| 8/19/2023 0:00 | $49.65 | FALSE | TRUE | |
| 8/12/2023 0:00 | $47.09 | FALSE | TRUE | |
| 8/5/2023 0:00 | $48.68 | FALSE | TRUE | |
| 6/24/2023 0:00 | $40.66 | FALSE | TRUE | |
| 6/17/2023 0:00 | $46.03 | FALSE | TRUE | |
| 6/10/2023 0:00 | $47.61 | FALSE | TRUE | |
| 6/3/2023 0:00 | $48.60 | FALSE | TRUE | |
| 5/27/2023 0:00 | $48.19 | FALSE | TRUE | |
| 5/20/2023 0:00 | $45.53 | FALSE | TRUE | |
| 5/13/2023 0:00 | $48.08 | FALSE | TRUE | |
| 5/6/2023 0:00 | $45.81 | FALSE | TRUE | $45.81 |
| 3/25/2023 0:00 | $39.15 | FALSE | FALSE | |
| 3/18/2023 0:00 | $38.77 | FALSE | TRUE | |
| 3/11/2023 0:00 | $39.09 | FALSE | TRUE | |
| 3/4/2023 0:00 | $38.52 | FALSE | FALSE | |
| 1/28/2023 0:00 | $38.87 | FALSE | FALSE |
3 Replies
- lbendlin
Super User
Your increase/decrease columns don't seem to match your data. Please clarify.
- vivica19Frequent Visitor
The ANY_PRICE_INC and ANY_PRICE_DEC columns are based on other calculations of price variation (short/long time). they mean that the ASP changed at any moment over a period of time. I only included the columns I need for the flag. I included the ASP because I need it in the result, but if I can get the date it will also work for me.
- Ahmedx
Super User
Based on your description, I created data to reproduce your scenario. The pbix file is attached in the end.