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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
Avivek
Post Partisan
Post Partisan

Need help with the dax

I need help with a dax, the dax at present is 

YOY Sales Growth details % = if([To Year Sales]>0,DIVIDE([To Year Sales]-[Sales Amount],[Sales Amount])*100)
Avivek_0-1649313993496.png

 

If, from YTD is blank % should show as +100 and if To YTD is blank then it should show as %  column should show as -100. Can someone please help me with this dax
1 ACCEPTED SOLUTION
VijayP
Super User
Super User

@Avivek 

IF(isblank(from Ytd),"100"%, if(isblank(to ytd),"-100",DIVIDE([To Year Sales]-[Sales Amount],[Sales Amount])*100)
Try this!

 




Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
MY Blog || My YouTube Channel || Connect with me on Linkedin || My Latest Data Story - Ageing Analysis

Proud to be a Super User!


View solution in original post

3 REPLIES 3
Tahreem24
Super User
Super User

@Avivek Try this:

YOY Sales Growth details % =
Var result_ = if([To Year Sales]>0,DIVIDE([To Year Sales]-[Sales Amount],[Sales Amount])*100)
RETURN SWITCH(TRUE(),
                             [From YTD]=BLANK(), 100,

                              [To YTD]=BLANK(),-100,
                              result_
                          )

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard
VijayP
Super User
Super User

@Avivek 

IF(isblank(from Ytd),"100"%, if(isblank(to ytd),"-100",DIVIDE([To Year Sales]-[Sales Amount],[Sales Amount])*100)
Try this!

 




Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
MY Blog || My YouTube Channel || Connect with me on Linkedin || My Latest Data Story - Ageing Analysis

Proud to be a Super User!


Wow, @VijayP , thankyou, i was tryig similar measure but now I can see what was the mistake i made. Thankyou for your help.

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors