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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Anonymous
Not applicable

subtracting net revenue with the year therefor - return blank

Hi, 

 

I need to subtract the net revenue 2017 with the net revenu from 2016, but also with the same quarter. 

I tried a code but it return nothing.

calc.PNG

 

 

 

 

 

 

Screenshot1.PNG

 

 

 

 

 

 

Many thanks for any help you can give me!

3 REPLIES 3
v-xicai
Community Support
Community Support

Hi @Anonymous ,

 

You can create measure like DAX below.

 

 

NetRevenue VS. Same Quarter Last Year =
VAR LastYear =
    CALCULATE (
        SUM ( Table1[NetRevenue] ),
        FILTER (
            ALLSELECTED ( Table1 ),
            Table1[Month] = MAX ( Table1[Month] )
                && Table1[Year]
                    = MAX ( Table1[Year] ) - 1
        )
    )
RETURN
    IF ( LastYear = BLANK (), BLANK (), MAX ( [NetRevenue] ) - LastYear )

 

 

Best Regards,

Amy

 

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

Anonymous
Not applicable

Hi @v-xicai ,

 

thanks for your reply!

I tried using your code and tweaking the values, but for some reason the result is still wrong.

My answer should be equal to -2.103.328,01 for quarter 4.

 

6.169.973,74 (net revenue 2017 Q 4)- 8.273.301,75 (net revenue 2016 Q 4) = -2.103.328,01. 

 

The problem that I have now, is that the code works, but I have not the value that I was expected. 

Am I missing something?

 

resultat.PNG

 

rr.PNG

 

 

Hi @Anonymous ,

 

Assuming that there is a relationship between the table Sales and Dates on date field, you can try to change the field Dates[Month] to Dates[Quarter] in formula above.

 

Best Regards,

Amy

 

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

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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