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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Calculate value for combined months

Manual&1&1&2&2 
OriginalJanFebMarAprMayJunJulAug
Sales2000400300500300500900400
Target2100300500200250550600800
%95%133%60%250%120%91%150%50%
AdjustedJanFebMarAprMayJunJulAug
Sales2400240080080030050013001300
Target2400240070070025055014001400
%100%100%114%114%120%91%93%93%

 

Hi All,

I need to create a measure to show the Sales, Target and % achievement as shown in above adjusted table, currently my measure is showing as the original table, is there anyway to solve this? 

 

Let me clarify my message as i think it's not clear enough. For the selected months that needs to be combined (eg, Jan & Feb, Mar & Apr) - indicated manually in calendar table, I need to sum up the sales and target for both months, and the sum should be reflected in the matrix as shown in the example adjusted table above. 

 

Thanks in advance! 

3 REPLIES 3
rajendraongole1
Super User
Super User

Hi @Anonymous - To create a measure in Power BI that reflects the values in your adjusted table, you need to define measures for Sales, Target

create sales measure:

Adjusted Sales =
SWITCH(
SELECTEDVALUE(YourTable[Month]),
"Jan", 2400,
"Feb", 2400,
"Mar", 800,
"Apr", 800,
"May", 300,
"Jun", 500,
"Jul", 1300,
"Aug", 1300,
0 // Default case
)

similarly,another measure for target

Adjusted Target =
SWITCH(
SELECTEDVALUE(YourTable[Month]),
"Jan", 2400,
"Feb", 2400,
"Mar", 700,
"Apr", 700,
"May", 250,
"Jun", 550,
"Jul", 1400,
"Aug", 1400,
0 // Default case
)

 

last calculation for percentage 

Adjusted % Achievement =
DIVIDE(
[Adjusted Sales],
[Adjusted Target],
0 // Default case for division by zero
)

 

Hope it works at your end. 





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

Proud to be a Super User!





Kedar_Pande
Super User
Super User

@Anonymous 

You can try:

Adjusted Sales = 
VAR CurrentMonth = MAX('Date'[Month])
VAR SalesValue = CALCULATE(
MAX('SalesTable'[Sales]),
'Date'[Month] <= CurrentMonth
)
RETURN SalesValue
Adjusted Target = 
VAR CurrentMonth = MAX('Date'[Month])
VAR TargetValue = CALCULATE(
MAX('SalesTable'[Target]),
'Date'[Month] <= CurrentMonth
)
RETURN TargetValue
Adjusted % Achievement = 
DIVIDE([Adjusted Sales], [Adjusted Target], 0)

Ensure that your date table has a continuous monthly sequence so that the calculation fills forward correctly.

 

💌 If this helped, a Kudos 👍 or Solution mark would be great! 🎉
Cheers,
Kedar
Connect on LinkedIn

shafiz_p
Super User
Super User

Hi @Anonymous Try below codes:

Adjusted Sales:

AdjustedSales = 
CALCULATE(
    SUM(FactSales[Sales]),
    ALLSELECTED('Calendar'[Month])
)

Adjusted Target:

AdjustedTarget = 
CALCULATE(
    SUM(FactSales[Target]),
    ALLSELECTED('Calendar'[Month])
)

Adjusted % Achievement:

AdjustedAchievement = 
DIVIDE(
    [AdjustedSales],
    [AdjustedTarget],
    0
)

 

Hope this helps!!

If this solved your problem, please accept it as a solution and a kudos!!

 

Best Regards,
Shahariar Hafiz

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors