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

Get certified as a Fabric Data Engineer: Check your eligibility for a 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700. Get started

Reply
ashmitp869
Helper V
Helper V

Help with measures - when half of the data is in old system and rest in new System for One Project?

Hi All,

I have a Projects (ABC001) whose where half of data (Jul 2024 to Feb 2025)is in old system and from Mar2025 the data will be in "NewSystem" .
How can I combine the two data to give the total value  for PTD - Billed (Ex- GST).

 

Please suggest.

 

PTD - Billed(Ex-GST) = 
var _max = max(vFactBudgetActuals[Transaction Date])
RETURN

SWITCH(
SELECTEDVALUE(Projects[DataSource]),
"OldSystem",CALCULATE([Revenue Amount] - Sum(vFactBudgetActuals[Cost Amount]),vFactBudgetActuals[Service ID] = "REVENUE",
                         FILTER(SM,SM[Service Group Level 0] ="REVENUE"),
                         //FILTER(ALL('Date'),'Date'[Date] <= _max)
                         FILTER(all('Date'),'Date'[Date] <=max('Date'[Date]))
                         //FILTER('Date','Date'[Year] <=SELECTEDVALUE('Date'[Year]) && 'Date'[Month] <= SELECTEDVALUE('Date'[Month])
                         ) 

,
    "NewSystem",
    CALCULATE(SUM(PJC[TOTAMTSR]),            
            FILTER(all('Date'),'Date'[Date] <=max('Date'[Date]))            
            ,
            PJC[CATEGORY]  = "REVENUE"
        )
)

Regards 

3 REPLIES 3
rajendraongole1
Super User
Super User

Hi @ashmitp869  - I have modified the above measure, can you please try the below one.

 

PTD - Billed(Ex-GST) =
VAR _maxDate = MAX(vFactBudgetActuals[Transaction Date])

VAR OldSystemRevenue =
CALCULATE(
[Revenue Amount] - SUM(vFactBudgetActuals[Cost Amount]),
vFactBudgetActuals[Service ID] = "REVENUE",
FILTER(SM, SM[Service Group Level 0] = "REVENUE"),
FILTER(ALL('Date'), 'Date'[Date] <= _maxDate && 'Date'[Date] <= DATE(2025,2,28)) -- Up to Feb 2025
)

VAR NewSystemRevenue =
CALCULATE(
SUM(PJC[TOTAMTSR]),
FILTER(ALL('Date'), 'Date'[Date] <= _maxDate && 'Date'[Date] >= DATE(2025,3,1)), -- From Mar 2025 onward
PJC[CATEGORY] = "REVENUE"
)

RETURN
OldSystemRevenue + NewSystemRevenue

 

Hope it works. please check.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Can you also help with the MTD and YTD expression as well

MTD - Billed(Ex-GST) = 
 SWITCH(
SELECTEDVALUE(Projects[DataSource]),
"OldSystem",CALCULATE([Revenue Amount] - Sum(vFactBudgetActuals[Cost Amount]),vFactBudgetActuals[Service ID] = "REVENUE") 
,
    "NewSystem",
    CALCULATE(
    TOTALMTD(
        SUM(PJC[TOTAMTSR]),
        'Date'[Date],
        FILTER(PJC, PJC[CATEGORY]  = "REVENUE")
    )
)
)

 

 

YTD - Billed(Ex-GST) = 

SWITCH(
SELECTEDVALUE(Projects[DataSource]),
"OldSystem",CALCULATE([Revenue Amount] - Sum(vFactBudgetActuals[Cost Amount]),vFactBudgetActuals[Service ID] = "REVENUE" ,
                        DATESYTD('Date'[Date],"6/30"),
                        FILTER(SM,SM[Service Group Level 0] ="REVENUE")) 

,
    "NewSystem",
    CALCULATE(
            SUM(PJC[TOTAMTSR]),
            DATESYTD('Date'[Date], "6/30"),
        FILTER(PJC, PJC[CATEGORY]  = "REVENUE")
    )
)

Hi @ashmitp869  - Your MTD (Month-to-Date) and YTD (Year-to-Date) calculations for Billed (Ex-GST) are mostly correct.

 

I have updated few please check the below:

MTD - Billed(Ex-GST) =
VAR _selectedDataSource = SELECTEDVALUE(Projects[DataSource])

RETURN
SWITCH(
_selectedDataSource,

"OldSystem",
CALCULATE(
[Revenue Amount] - SUM(vFactBudgetActuals[Cost Amount]),
vFactBudgetActuals[Service ID] = "REVENUE",
TOTALMTD(SUM([Revenue Amount]), 'Date'[Date]) -- Apply Month-to-Date filter
),

"NewSystem",
CALCULATE(
TOTALMTD(
SUM(PJC[TOTAMTSR]),
'Date'[Date]
),
PJC[CATEGORY] = "REVENUE"
)
)

 

for YTD:

YTD - Billed(Ex-GST) =
VAR _selectedDataSource = SELECTEDVALUE(Projects[DataSource])

RETURN
SWITCH(
_selectedDataSource,

"OldSystem",
CALCULATE(
[Revenue Amount] - SUM(vFactBudgetActuals[Cost Amount]),
vFactBudgetActuals[Service ID] = "REVENUE",
DATESYTD('Date'[Date], "6/30") -- Apply Year-to-Date filter
),

"NewSystem",
CALCULATE(
SUM(PJC[TOTAMTSR]),
DATESYTD('Date'[Date], "6/30"),
PJC[CATEGORY] = "REVENUE"
)
)

 

Hope this works at your end. please check and confirm.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan NL Carousel

Fabric Community Update - January 2025

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