Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now
hi,
I have a table:
Sequence Forecast Orders 1 10 4 2 21 50 3 32 24 4 11 21 5 55 11
I need to find the 1st sequence that cummulative of orders > cummulative forecast. In this case, it is 2.
I wrote the below measure, but it is not working:
1stseq = var cumforecast = CALCULATE(SUM('Table'[Forecast]), FILTER(ALL('Table'), 'Table'[Sequence] <= MAX('Table'[Sequence]))) var cumorder = CALCULATE(SUM('Table'[Orders]), FILTER(ALL('Table'), 'Table'[Sequence] <= MAX('Table'[Sequence]))) var firstseq = CALCULATE(FIRSTNONBLANK('Table'[Sequence], 0), FILTER(ALL('Table'), cumorder >= cumforecast)) return firstseq
here is the PBI file:
https://1drv.ms/u/s!Aps8poidQa5zk7FOhEXm9PiaatnpCw?e=9JVp7E
thanks
Solved! Go to Solution.
Hi @Iamnvt
Try this measure in a card visual:
1stSeq V2 = MINX ( 'Table'; IF ( CALCULATE ( SUM ( 'Table'[Orders] ) - SUM ( 'Table'[Forecast] ); ALL ( 'Table' ); 'Table'[Sequence] <= EARLIER ( 'Table'[Sequence] ) ) > 0; 'Table'[Sequence] ) )
Please mark the question solved when done and consider giving kudos if posts are helpful.
Cheers
Hi @Iamnvt
Try this measure in a card visual:
1stSeq V2 = MINX ( 'Table'; IF ( CALCULATE ( SUM ( 'Table'[Orders] ) - SUM ( 'Table'[Forecast] ); ALL ( 'Table' ); 'Table'[Sequence] <= EARLIER ( 'Table'[Sequence] ) ) > 0; 'Table'[Sequence] ) )
Please mark the question solved when done and consider giving kudos if posts are helpful.
Cheers
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
86 | |
85 | |
84 | |
67 | |
49 |
User | Count |
---|---|
131 | |
112 | |
99 | |
69 | |
67 |