Forum Discussion
Raj12
Helper III
3 years agoMeasure to calculate data based on two sources : DB table & excel file for different time period
Need to calculate total quotes: 1) For current and last 13 months data is available in live DB 2) For period earlier than 13 month data is redacted from DB and hence need an excel file to fetch tha...
lbendlin
Super User
3 years agoSounds straightforward. What have you tried and where are you stuck?
Raj12
Helper III
3 years agoI created a measure but unable to get data chnage over the period of time:
Total Quotes =
var mon_start_date = CALCULATE(Min(DateTable[Date] ),ALLSELECTED(DateTable[Date] ))
var mon_end_date = CALCULATE(Max( DateTable[Date] ),ALLSELECTED(DateTable[Date] ))
var yr = VALUE(SELECTEDVALUE(DateTable[Date]))
var curr_mon= MONTH(TODAY())
var curr_year= YEAR(TODAY())
return
if (DATE(curr_year-1,curr_mon,31)<=mon_start_date,
CALCULATE(SUM('Historical Data Table'[Total Quotes]),'Historical Data Table'[Year]=curr_year-1 && 'Historical Data Table'[Month]=curr_mon),
CALCULATE(SUM('Historical Data Table'[Total Quotes]),'Historical Data Table'[Year]=curr_year-1 && 'Historical Data Table'[Month]=curr_mon),
CALCULATE(DISTINCTCOUNT('DB'[QUOTE ID]),'DB'[QDATE]>=mon_start_date && 'MSQUREFR New'[QDATE]<=mon_end_date) )