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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
abc_777
Super User
Super User

calculation

Hi,

 

I have a calculation error

 

Target Quantity Company (Yearly) =
var a = CALCULATE([Same Month Previous Year Quantity],SAMEPERIODLASTYEAR(BMCalendar[Date]))
    return
        if(ISBLANK(a),[Same Month Previous Year Quantity], a * 1.2 )
 
abc_777_1-1686386034511.png

 

but expected result should be 4271791.66 * 1.2 =  5,126,149.992 but my Target Quantity Company (Yearly) gives me 2641923.67.

 

please correct me 

 

thanks


 

1 ACCEPTED SOLUTION

its k i correct it

View solution in original post

2 REPLIES 2
Ritatyna
Regular Visitor

Looks like you made a mistake in your DAX. Try 
Target Quantity Company (Yearly) =
VAR a = CALCULATE([Same Month Previous Year Quantity], SAMEPERIODLASTYEAR(BMCalendar[Date]))
RETURN
IF(ISBLANK(a), [Same Month Previous Year Quantity] * 1.2, a * 1.2)

its k i correct it

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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.