Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. 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
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
76 | |
76 | |
55 | |
36 | |
34 |
User | Count |
---|---|
99 | |
56 | |
53 | |
44 | |
40 |