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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
Raj007
Helper III
Helper III

what is that i am missing...need to calculate the %sales of year sales

Hi All,

Thanks for your time.. i am just trying to understand with some sample data of adventure works.. i was able to follow and create the 

some metrics... like % of Grand Total sales - what is the sales percentage of each month when compared to the grand total

i was trying to do the same thing but for the year.. what is the sales percenatage of each month when compared to the TOTAL of the YEAR.. i used ALL and ALLEXCEPT..but i do not get the correct value

1).i have a date table

2).i have fact internet sales table

3).I have custom measures table..just for the measures only

Iam missing something in ALLEXCEPT

% of Year Sales Total = [vSalesAmount_Sumx1]/CALCULATE([vSalesAmount],ALLEXCEPT(dDate,dDate[Month]))

 

again, thanks a lot for your time...below is the screenshot of what i have

 

 

screenshot.png

1 ACCEPTED SOLUTION

@Raj007 , Try with all selected , I am trying to keep only year filter,

 

% of Year Sales Total = divide([vSalesAmount_Sumx1], CALCULATE([vSalesAmount_Sumx1],filter(ALLSELECTED('dDate'),'dDate'[Year]=max('dDate'[Year]))) )

 

make sure month and year in visual some from dDate table

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@Raj007 , Try like

% of Year Sales Total = divide([vSalesAmount_Sumx1], CALCULATE([vSalesAmount_Sumx1],filter(ALL('dDate'),'dDate'[Year]=max('dDate'[Year]))) )

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Hi Amit, thanks a lot,

% of Year Sales Total = [vSalesAmount]/CALCULATE([vSalesAmount],ALLEXCEPT(dDate,dDate[Year]))
 i get the same result as your expression.. i see you are using FILTER(ALL(table),filter expression)
why did we use the max? - if i use your expression - i see 6400% in grand total .. i think this can be fixed
just trying to understand..again thanks a lot

@Raj007 , Try with all selected , I am trying to keep only year filter,

 

% of Year Sales Total = divide([vSalesAmount_Sumx1], CALCULATE([vSalesAmount_Sumx1],filter(ALLSELECTED('dDate'),'dDate'[Year]=max('dDate'[Year]))) )

 

make sure month and year in visual some from dDate table

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Helpful resources

Announcements
OCT PBI Update Carousel

Power BI Monthly Update - October 2024

Check out the October 2024 Power BI update to learn about new features.

October NL Carousel

Fabric Community Update - October 2024

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