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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
RobertoSantos83
Frequent Visitor

DAX for revenue for next 11 months

Hi,I WANT to see the Revenue On the Books for a given period of time

  1. Example: Date Range selected of 11/05/23 - 11/27/23
    1. Starting Month will be Nov 23
    2. Data for Nov 23 would show all Revenue for Stays with the stay date range of 11/1/23 -11/30/23.
    3. All subsequent months will follow the same rules. 
      RobertoSantos83_2-1700670590992.png

       

      By the below measure, I got the revenue as expected but was unable to show it for the next 12 months from the selected month. Its showing back 12 without an order.

Adjust Revenue for 12M =

VAR selected_month_start = DATE(YEAR(MIN('Calendar'[Date])), MONTH(MIN('Calendar'[Date])), 1)
VAR selected_month_end = EOMONTH(selected_month_start, 11)

RETURN
SUMX(
    VALUES('Calendar'[YearMonth]),
    CALCULATE(
        SUM('report vwRevenueDashboardReport_Revenueforstays'[Revenue]),
        FILTER(
            ALL('Calendar'),
            'Calendar'[YearMonth] = EARLIER('Calendar'[YearMonth]) &&
            'Calendar'[Date] >= selected_month_start &&
            'Calendar'[Date] <= selected_month_end
        )
    )
)
After this, I am getting the below format: In the below image, I selected the date as September, so in the matrix column, the starting column should be September, following 11 months into the future. Can anybody help me out there? Thanks in advance.
RobertoSantos83_3-1700671336676.png

 




3 REPLIES 3
lbendlin
Super User
Super User

Contrary to what you may think EOMONTH will not cover the entire month unless it has data.

 

How can you have future revenue?  Are you applying amortization?

Hi @lbendlin This is the revenue for bookings at the hotel. Let me explain clearly. I am planning to stay in a hotel next month, but I am reserving today, which is the created date. I am going to stay in the hotel next month (and maybe in the next couple of years), where the revenue is calculated based on stays between arrival and departure dates.

Tezaroyal_0-1700853545010.png

 

Please provide sample data (with sensitive information removed) that covers your issue or question completely, in a usable format (not as a screenshot). Leave out anything not related to the issue.
If you are unsure how to do that please refer to https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.