Note: Forums will be making significant UX changes to address key usability improvements surrounding search, discoverability and navigation. To learn more about these changes please visit the announcement which can be found HERE.
How to Correctly Calculate the Number of Transaction Open and Closed in A Period

คำตอบ How to Correctly Calculate the Number of Transaction Open and Closed in A Period

  • 6 เมษายน 2555 20:14
     
     

    I have Four Tables

    1. a View Dimension Table
    2. a Transaction Fact Table
    3. a Transaction OpenDate Table
    4. a Transaction ClosedDate Table

    they are Related as Follows

    Using this structure I have Been Able to sucessfully create a Count of Transaction Created in Any Periid and Transactions Closed on Any Period.

    Transactions Open=COUNTA('Transaction Open'[TransactionNo])
    Transactions Clsed=COUNTA('Transaction Closed'[TransactionNo])

    What I want however is aslo to count how many Transaction were open and Closed With a Period . Because I cannot have any more Relationships I pulled the Transaction Created date into the Transaction Closed PowerPivot Table Using the following

    Transaction Close Table[XcreatedDate]=MAXX(FILTER(ALL('Transaction Open Table'),'Transaction OPen Table'[TransactionNo]= 'Transaction Closed Table'[Transaction No]),'Transaction Open Table'[OpenDate])

    So I tried to Create a Measure OpenClosedInPeirod on The Transaction Closed Date Table as follows

    OpenClosed =COUNTROWS('Transaction Closed Date', 'Transaction Closed Date'[Xcreated]>=FIRSTDATE('VTimeDimension[Date]) && 'Transaction Closed Date'[Closeddate]<=LASTDATE('VTimeDimension[Date]))

    This Worked for Days and Weeks but Fails to Aggregate correctly for Month and Quarters

    Any Suggestions

ตอบทั้งหมด