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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
petrosk
Frequent Visitor

Lookup a value as of a date within a filtered range of dates

Suppose I have a Fact Table of Account Balances, Investments, and Dates (reference below illustration). This Fact Table is related to a Calendar Dimension Table. How could I determine the account balance for a specific investment within a filtered date range?

 

Examples: (1) Show me the Account Balance of Investment 101 as of the Maximum Date in Calendar Year 2015. (2) Show me the Account Balance of Investment 103 as of the Minimum Date in Calendar Year 2016.

 

I imagine there is a simple solution to this issue, but I have been struggling to find an answer.

 

Fact Table Illustration

DateBalanceInvestmentID
Friday, December 30, 20165.00101
Friday, December 30, 20167.00102
Friday, December 30, 201610.00103
Wednesday, November 30, 201610.00101
Wednesday, November 30, 20168.00102
Wednesday, November 30, 20168.00103
Monday, October 31, 201614.00101
Monday, October 31, 201612.00102
Monday, October 31, 20168.00103
Friday, September 30, 201612.00101
Friday, September 30, 201610.00102
Friday, September 30, 201615.00103
Wednesday, August 31, 20163.00101
Wednesday, August 31, 201610.00102
Wednesday, August 31, 201612.00103
Friday, July 29, 20161.00101
Friday, July 29, 20168.00102
Friday, July 29, 20167.00103
Thursday, June 30, 20163.00101
Thursday, June 30, 201611.00102
Thursday, June 30, 20168.00103
Tuesday, May 31, 201613.00101
Tuesday, May 31, 20164.00102
Tuesday, May 31, 201612.00103
Friday, April 29, 20161.00101
Friday, April 29, 20162.00102
Friday, April 29, 201614.00103
Thursday, March 31, 201615.00101
Thursday, March 31, 20166.00102
Thursday, March 31, 201614.00103
Monday, February 29, 20169.00101
Monday, February 29, 20166.00102
Monday, February 29, 20165.00103
Friday, January 29, 201613.00101
Friday, January 29, 201615.00102
Friday, January 29, 20161.00103
Thursday, December 31, 20153.00101
Thursday, December 31, 201513.00102
Thursday, December 31, 201514.00103
Monday, November 30, 20153.00101
Monday, November 30, 201515.00102
Monday, November 30, 201514.00103
Friday, October 30, 20151.00101
Friday, October 30, 201510.00102
Friday, October 30, 201511.00103
Wednesday, September 30, 20155.00101
Wednesday, September 30, 201510.00102
Wednesday, September 30, 201510.00103
Monday, August 31, 201511.00101
Monday, August 31, 20153.00102
Monday, August 31, 20159.00103
Friday, July 31, 20152.00101
Friday, July 31, 20156.00102
Friday, July 31, 20154.00103
Tuesday, June 30, 20152.00101
Tuesday, June 30, 20151.00102
Tuesday, June 30, 201510.00103
Friday, May 29, 201515.00101
Friday, May 29, 201514.00102
Friday, May 29, 20153.00103
Thursday, April 30, 20158.00101
Thursday, April 30, 20152.00102
Thursday, April 30, 20159.00103
Tuesday, March 31, 20155.00101
Tuesday, March 31, 201510.00102
Tuesday, March 31, 20159.00103
Friday, February 27, 20156.00101
Friday, February 27, 20158.00102
Friday, February 27, 20154.00103
Friday, January 30, 20156.00101
Friday, January 30, 201510.00102
Friday, January 30, 20152.00103
Wednesday, December 31, 20149.00101
Wednesday, December 31, 201414.00102
Wednesday, December 31, 20145.00103
1 ACCEPTED SOLUTION

You need a semi additive measure pattern. Read up in it here http://www.sqlbi.com/articles/semi-additive-measures-in-dax/



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.

View solution in original post

1 REPLY 1

You need a semi additive measure pattern. Read up in it here http://www.sqlbi.com/articles/semi-additive-measures-in-dax/



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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