Forum Discussion

BoatAnalytics's avatar
BoatAnalytics
Frequent Visitor
1 year ago
Solved

Event in Progress - 2 Different Dates. Measuring Sales & Event status

Hi,

 

I am stuck working on a Events in Progress with two dates. I have sales from Yesterday that uses the Active Relationship with the Order Date. I want to take yesterday's Sales and put them into a column with the associated Event Date. 

 

Here is my Yesterday's ticket measure:

 

Tickets in Progress =
                        Calculate([# Tickets], filter(Dates,Dates[Date] = Today()-1))

 

Then I wanted to get these sales tickets, but put them in the associated Events dates. The 195 is the last Sales Dates but I want a seperate column that spreads those over the days the events were bought for.  Thats what I am having a problem with. 

 

Tickets Yesterday = Sumx(
                'Dates',
                   Calculate( [# Tickets],USERELATIONSHIP(Tickets[EventDatePT, Calc],Dates[Date])))

 

I tried this measure, but it keeps defaulting to the "Event Tickets" Date in those days instead of the "Sales Tickets" Date. 

 

Any help I'd appreciate. Thanks!

 

 

 

 

  • Anonymous's avatar
    Anonymous
    1 year ago

    Hi BoatAnalytics ,

     

    According to your statement, I think your requirement is to combine two measures and then get the sum.

    I think you can try code as below to create a measure.

    MEASURE =
    SUMX (
        SUMMARIZE (
            Dates,
            Dates[Date],
            "Result",
                IF ( [Date] = TODAY () - 1, [Tickets in Progress], [Tickets - Event Date] )
        ),
        [Result]
    )

    The result of my sample is as below.

     

    Best Regards,
    Rico Zhou

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

3 Replies

  • Ploximity's avatar
    Ploximity
    Regular Visitor

    Have you tried restructuring your matrix?

    Matrix rows is Dates[Date].

    Then use the measure Calculate( [# Tickets],USERELATIONSHIP(Tickets[EventDatePT, Calc],Dates[Date]))

  • BoatAnalytics's avatar
    BoatAnalytics
    Frequent Visitor

    Hi - I believe I have the rows already with the Dates[Date] row.

     

    Is there a Variable I can use to Maybe pull the 195 number as yesterday's tickets. Then, ingnore the Real Creation Date Relationship and use the inactive? USERELATIONSHIP(Tickets[EventDatePT, Calc],Dates[Date])

     

    Thanks for responding to me Ploximity  🙂

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi BoatAnalytics ,

       

      According to your statement, I think your requirement is to combine two measures and then get the sum.

      I think you can try code as below to create a measure.

      MEASURE =
      SUMX (
          SUMMARIZE (
              Dates,
              Dates[Date],
              "Result",
                  IF ( [Date] = TODAY () - 1, [Tickets in Progress], [Tickets - Event Date] )
          ),
          [Result]
      )

      The result of my sample is as below.

       

      Best Regards,
      Rico Zhou

      If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.