Forum Discussion

rashidanwar's avatar
rashidanwar
Icon for Advocate II rankAdvocate II
4 years ago
Solved

Current month vs Previous month - Receiving error for current month value

 Hi everyone

I have a data set with 3 columns. you can see the image below. Now I want to create a measure to calculate current month value and previous month value and then a difference amount between the two. 

I have done so but  I am facing the problem with the current month measure. I am getting an error when I put the current month measure in the matrix. See the Image below.

But when I put the previous month measure calculated the same way it's working fine. See the below image.


I would appreciate any help in this regard. Thank you!
Here is the power BI desktop file link

Best Regards
Rashid Anwar

 

  • The measures are overcomplex.  I think the current month will just be [TotalSum]

    and 

    PreviousMonth will probably be 

    CALCULATE([TotalSUM], PREVIOUSMONTH('Date'[Date])) <- I haven't tested it with your model
    -
    Give it a go

2 Replies

  • HotChilli's avatar
    HotChilli
    Icon for Community Champion rankCommunity Champion

    The measures are overcomplex.  I think the current month will just be [TotalSum]

    and 

    PreviousMonth will probably be 

    CALCULATE([TotalSUM], PREVIOUSMONTH('Date'[Date])) <- I haven't tested it with your model
    -
    Give it a go
  • v-xiaotang's avatar
    v-xiaotang
    Icon for Community Support rankCommunity Support

    Hi rashidanwar 

    I just want to confirm if you resolved this issue? If yes, you can accept the answer helpful as the solution or share you method and accept it as solution, thanks for your contribution to improve Power BI.

    If you need more help, please let me know.

     

    Best Regards,

    Community Support Team _Tang

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