Forum Discussion

brunofds's avatar
brunofds
Icon for Helper I rankHelper I
3 years ago

Unusual QUARTERS - DAX

Hello there. Dealing with a problem here in my dataset.  

 

For the sake of simplicity, I have a simple database with DimDate (from jan.1 to December 31) and FactOrders, using NorthWindDataset for this example (but my case is more complex)

 

What I need: for these measures, my QUARTERS will be unusual. 

 

Q1: December (previous year), Jan. and Feb.

Q2: Mar. Apr. and  May

Q3: ...

Q4: Sep. , Oct. and Nov.

 

 

 

 

 

Current measures:

Sales = SUMX(fOrder_Details,fOrder_Details[Quantity] * fOrder_Details[UnitPrice])
SalesPQ = CALCULATE( [Sales], PREVIOUSQUARTER('Date'[Date]))  (not used, just for comparison)

 

So how I handle this?  My view will be something like this:

 

 

So, in the example above, if a user select 1997 and Q1, the value should display the sum of Dec. 96 + Jan.97 + Feb. 97

 

Thanks

 

 

11 Replies

  • aj1973's avatar
    aj1973
    Icon for Community Champion rankCommunity Champion

    Hi brunofds 

    You need to change the structure of your DimDate, meaning that the Calendar Year should start from December 1st

    • brunofds's avatar
      brunofds
      Icon for Helper I rankHelper I

      Hey there. Thanks for your reply.

       

      Unfortunately i can't because i need to show my other measures in the current method, from Jan. 1 to Dec.31. 

      This is an exception...

      • aj1973's avatar
        aj1973
        Icon for Community Champion rankCommunity Champion

        You can add another Date Table or add other columns to your DimDate and use Inactive Relationship for calculations.