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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Fangyi890
New Member

DAX-mom revenue calculation by marketing campaign

I need help solving or finding te month on month revenue of a marketing campaign for 2 years. Please help. All other solutions don't work for me. Can it be calculated by court as well? 

Thanks in advance.

 

iddateuser_idsession_idbooking_idplacehoursrevenueprice (one hour)
46792019-12-31 00:00:00812038052013482spb213482court222556.455877
46782019-12-31 00:00:0081203805795633spb65633court611307.775987
46772019-12-31 00:00:00812038166912638spb812638court811239.00751039
46762019-12-31 00:00:0081203816997224spb67224court634315.6575987
46752019-12-31 00:00:00812037882319578spb419578court411265.375955
46742019-12-31 00:00:00812038059215417spb915417court911113.53764
46732019-12-31 00:00:0081203809763375spb43375court444555.35955
46722019-12-30 00:00:00812038180711234spb611234court611307.775987
46712019-12-30 00:00:00812037733316096spb616096court611176.9975987
46702019-12-30 00:00:008120376827423spb3423court311552.23751065
46692019-12-30 00:00:0081203814415585spb45585court411138.8375955
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Fangyi890 ,

 

Thanks lbendlin  for the quick reply. I have a bit of other ideas to add:

(1) Create a new calculated column.

YearMonth = FORMAT([date], "YYYY-MM")

(2) Create a measure.

MonthlyRevenue = 
CALCULATE(
    SUM('Table'[revenue]),
    FILTER(ALLEXCEPT('Table','Table'[YearMonth]),YEAR('Table'[date])<=YEAR(TODAY()) &&
    YEAR('Table'[date])>=YEAR(TODAY())-2
))

vtangjiemsft_0-1733454563382.png

If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.

 

Best Regards,

Neeko Tang

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

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @Fangyi890 ,

 

Thanks lbendlin  for the quick reply. I have a bit of other ideas to add:

(1) Create a new calculated column.

YearMonth = FORMAT([date], "YYYY-MM")

(2) Create a measure.

MonthlyRevenue = 
CALCULATE(
    SUM('Table'[revenue]),
    FILTER(ALLEXCEPT('Table','Table'[YearMonth]),YEAR('Table'[date])<=YEAR(TODAY()) &&
    YEAR('Table'[date])>=YEAR(TODAY())-2
))

vtangjiemsft_0-1733454563382.png

If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.

 

Best Regards,

Neeko Tang

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

lbendlin
Super User
Super User

Your sample data is insufficient. Please provide sample data that fully covers your issue.
Please show the expected outcome based on the sample data you provided.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.