The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hello Everyone,
I'm currently trying to replicate an Excel File on Power BI and I'm facing a problem with one of the formulas that are in this file.
Background :
Data : about 1 000 000 rows
Column Description :
What I've done :
What I want to do :
I want to recreate the following : Check for the 3Consecutive OutMax Column if the 3 Values that has been measured before my current value are OutMax = TRUE.
The ideal would be to be able to use a what if parameter to choose the number of consecutive value that I want to analyze (3,6,9... )
Thank you for your help !
Solved! Go to Solution.
Hi @Anonymous
You need an additional colum to establish sequential order. I see that there are repeated dates so that doesn't help. If you don't have one, add an index column in the query editor (Add column - >Add index column)
Then create an additional calculated column. I'm assuming you want to check by type independently:
ConsecutiveOutMax = VAR Last3_ = CALCULATETABLE ( DISTINCT ( Table1[OutMax] ), Table1[Index] <= EARLIER ( Table1[Index] ), Table1[Index] > ( EARLIER ( Table1[Index] ) - 3 ) ) RETURN IF ( FALSE () IN Last3_, FALSE (), TRUE () )
Hi @Anonymous
You need an additional colum to establish sequential order. I see that there are repeated dates so that doesn't help. If you don't have one, add an index column in the query editor (Add column - >Add index column)
Then create an additional calculated column. I'm assuming you want to check by type independently:
ConsecutiveOutMax = VAR Last3_ = CALCULATETABLE ( DISTINCT ( Table1[OutMax] ), Table1[Index] <= EARLIER ( Table1[Index] ), Table1[Index] > ( EARLIER ( Table1[Index] ) - 3 ) ) RETURN IF ( FALSE () IN Last3_, FALSE (), TRUE () )
User | Count |
---|---|
78 | |
74 | |
42 | |
32 | |
28 |
User | Count |
---|---|
104 | |
93 | |
52 | |
50 | |
46 |