Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
Hi there,
I have a question. I have the following dataset:
ID | Code | OpportunityID | Modified | YearMonth | StageID |
142 | SF000020 | 20 | 4/10/19 | 2019/04 | 5 |
106 | SF000020 | 20 | 4/4/19 | 2019/04 | 4 |
105 | SF000020 | 20 | 4/4/19 | 2019/04 | 4 |
99 | SF000020 | 20 | 3/29/19 | 2019/03 | 4 |
98 | SF000020 | 20 | 3/29/19 | 2019/03 | 3 |
87 | SF000020 | 20 | 3/25/19 | 2019/03 | 2 |
86 | SF000020 | 20 | 3/25/19 | 2019/03 | 2 |
85 | SF000020 | 20 | 3/25/19 | 2019/03 | 1 |
I want to know in a calculated column: the highest StageID per Code per month. In this example, the Code is filtered on 'SF00020', but in my dataset there are much more Codes.
So the solution should provide me for April StageID 5 and for March StageID 4.
I tried a few calculate(max(filter-options, but I couldn't solve the problem.
Cheers,
Johan
Solved! Go to Solution.
Hi,
Try this calculated column formula
=CALCULATE(MAX(Data[StageID]),FILTER(Data,Data[Code]=EARLIER(Data[Code])&&Data[YearMonth]=EARLIER(Data[YearMonth])))
Hope this helps.
Hi,
Try this calculated column formula
=CALCULATE(MAX(Data[StageID]),FILTER(Data,Data[Code]=EARLIER(Data[Code])&&Data[YearMonth]=EARLIER(Data[YearMonth])))
Hope this helps.
@johanthedataman add new measure using following expression
Max Stage = CALCULATE( MAX( Table4[StageID] ), ALLEXCEPT( Table4, Table4[Code], Table4[YearMonth] ) )
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
User | Count |
---|---|
77 | |
77 | |
68 | |
67 | |
49 |
User | Count |
---|---|
108 | |
104 | |
93 | |
83 | |
64 |