Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Determine Latest (MAX) Value by Index by Group

I have a dataset with several tables:

 

  • Fact Table: Spaces
    IDNameStage IDBuilding IDArea
    1Room111100
    2Room121125
    3Room211200
    4Room221180
    5Room3 11300
    6Room321350
    7Room 112100
    8Room 212200
    9Room 312315
  • Dim Tables:
    • Building
      IDName
      1Building1
      2Building2
    • Stage
      IDNameIndex
      1Stage11
      2Stage22
  1. Should I consider break out "Room" as a Dimension to a Fact Table which is only rows of different values for Room over each stage?

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]
Building1Stage265555
Building2Stage1615 

 

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!

1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

Picture1.png

 

https://www.dropbox.com/s/j4f2frdwzvvvg33/rpiboy.pbix?dl=0 

 

 


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

View solution in original post

3 REPLIES 3
Jihwan_Kim
Super User
Super User

Picture1.png

 

https://www.dropbox.com/s/j4f2frdwzvvvg33/rpiboy.pbix?dl=0 

 

 


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.
Anonymous
Not applicable

@Jihwan_Kim thanks for the solution, I mostly follow it, but I was hoping you could explain the Current Stage Measure a bit more?

 

  • I see that you're getting the Max index in the current context
  • I understand that calculate table basically returns a table with a single row, but I'm not clear on how the IF and HASONEVALUE is fitting in. It seems like you're making the assumption there will always be one value and there is no else clause defined for the IF.

Thank you,

-Robert

Anonymous
Not applicable

@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!

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.