Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
I have a dataset with several tables:
ID | Name | Stage ID | Building ID | Area |
1 | Room1 | 1 | 1 | 100 |
2 | Room1 | 2 | 1 | 125 |
3 | Room2 | 1 | 1 | 200 |
4 | Room2 | 2 | 1 | 180 |
5 | Room3 | 1 | 1 | 300 |
6 | Room3 | 2 | 1 | 350 |
7 | Room 1 | 1 | 2 | 100 |
8 | Room 2 | 1 | 2 | 200 |
9 | Room 3 | 1 | 2 | 315 |
ID | Name |
1 | Building1 |
2 | Building2 |
ID | Name | Index |
1 | Stage1 | 1 |
2 | Stage2 | 2 |
I'm trying to write a measure that will report the "Current Stage Value" such that a Table Visual might report this:
Building Name | [Current Stage] | [Sum Area] | [Variance from Previous Stage] |
Building1 | Stage2 | 655 | 55 |
Building2 | Stage1 | 615 |
I feel like I should be able to do this, but clearly stumbling. All the MAX examples I can find work from a single table, and many are often done as a Column and not a Measure. I'd prefer a Measure since it will react dynamically to filtering of stages, which would be desired, so that the "Max" Stage in the current context is always returned as the "Current" stage.
Thanks in advance!
Solved! Go to Solution.
https://www.dropbox.com/s/j4f2frdwzvvvg33/rpiboy.pbix?dl=0
https://www.dropbox.com/s/j4f2frdwzvvvg33/rpiboy.pbix?dl=0
@Jihwan_Kim thanks for the solution, I mostly follow it, but I was hoping you could explain the Current Stage Measure a bit more?
Thank you,
-Robert
@Jihwan_Kim this looks great! Will dig in a bit more tomorrow. Thank you very much. For some reason I had in my head that RELATED could only be used in Calculated Columns and not Measures! Clearly I was mistaken, argh!
User | Count |
---|---|
25 | |
12 | |
8 | |
7 | |
7 |
User | Count |
---|---|
25 | |
12 | |
11 | |
10 | |
6 |