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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Anonymous
Not applicable

How to stop Power BI combining months from separate years

Hello,

 

I have sales data from beginning of 2018 thru June 2019. I am trying to show the % of total sales dollars by order type for each month. Using the DAX shown in the below picture, I was able to get it to work for Jul 18 thru Dec 18. However, for any months that I have data for in both 2018 and 2019, the formula is taking the month from 2018 and dividing it by the combined 2018 and 2019 month. For example: For Jan 2018, the formula takes the dollar amount from Jan 2018 and divides it by Jan 2018 + Jan 2019. I need it to only divide by Jan 2018. 

 

Any solutions would be appreciated.

 

Thanks! 

 

InkedCapture_LI.jpg

1 ACCEPTED SOLUTION
jdbuchanan71
Super User
Super User

If you write a measure for Order Total:

Order Total = SUM ( 'Order Details'[Total] )

You can then write the % of total measure as:

Pct of type =
DIVIDE (
    [Order Total],
    CALCULATE ( [Order Total], ALL ( 'Order Details'[Order Type 2] ) )
)

This should respect the moth year properly.

View solution in original post

1 REPLY 1
jdbuchanan71
Super User
Super User

If you write a measure for Order Total:

Order Total = SUM ( 'Order Details'[Total] )

You can then write the % of total measure as:

Pct of type =
DIVIDE (
    [Order Total],
    CALCULATE ( [Order Total], ALL ( 'Order Details'[Order Type 2] ) )
)

This should respect the moth year properly.

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!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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