简体   繁体   中英

SSAS Get last not empty measure

I am new to SQL Server BI. We want to track fee changes by date.

Our fact table looks like:

Date :       Fee
01.01.2000   100
01.05.2000   200
15.08.2004   300

Now we want do get the last valid fee for a Date filter. When I ask show me the fee for year 2002 the SAAS should return 200.

Is it possible to build a Calculated Measure, or what is the best approach for this?

We have over 2 Millions Customers, when i am filled this factbased do i have to transfer 2 Millions fee dates every day? There must be better solution :-)

At the moment i get no Measure when I am filter Date 2002.

thx

Use the "Last Ever Non Empty"-approach, as described excellently by Chris Webb in this article .

The approach is basically to create a calculated member that consists of all members up to and including the selected date. From this, you find the last member that has any value.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM