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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
FatBlackCat30
Employee
Employee

Mont over month calculation using DAX

Hi all,

 

I am trying to create a DAX measure to use in a card visual that will show the month over month change where type = customer

 

For this example I need to grab the 1/31/2021 value for type = customer (20) and subtract the 12/31/2020 value for type = customer (1317). I tried using the Prevmonth function but its not giving me the correct value. What would be the best approach to solve this?

 

The data looks like this:

 

dateIDTypeValue
2/1/20211customer10
2/1/20211internal 15
1/31/20211customer20
1/31/20211internal 56
1/29/20211customer96
1/29/20211internal 103
1/28/20211customer125
1/28/20211internal 146
1/27/20211customer167
1/27/20211internal 189
1/26/20211customer210
1/26/20211internal 231
1/25/20211customer252
1/25/20211internal 274
1/24/20211customer295
1/24/20211internal 316
1/23/20211customer338
1/23/20211internal 359
1/22/20211customer380
1/22/20211internal 402
1/21/20211customer423
1/21/20211internal 444
1/20/20211customer465
1/20/20211internal 487
1/19/20211customer508
1/19/20211internal 529
1/18/20211customer551
1/18/20211internal 572
1/17/20211customer593
1/17/20211internal 615
1/16/20211customer636
1/16/20211internal 657
1/15/20211customer678
1/15/20211internal 700
1/14/20211customer721
1/14/20211internal 742
1/13/20211customer764
1/13/20211internal 785
1/12/20211customer806
1/12/20211internal 828
1/11/20211customer849
1/11/20211internal 870
1/10/20211customer891
1/10/20211internal 913
1/9/20211customer934
1/9/20211internal 955
1/8/20211customer977
1/8/20211internal 998
1/7/20211customer1019
1/7/20211internal 1041
1/6/20211customer1062
1/6/20211internal 1083
1/5/20211customer1104
1/5/20211internal 1126
1/4/20211customer1147
1/4/20211internal 1168
1/3/20211customer1190
1/3/20211internal 1211
1/2/20211customer1232
1/2/20211internal 1254
1/1/20211customer1275
1/1/20211internal 1296
12/31/20201customer1317
12/31/20201internal 1339

 

Thank you!

1 ACCEPTED SOLUTION
parry2k
Super User
Super User

@FatBlackCat30 solution attached, I added multiple measures to understand the solution. You can tweak it as you see fit.

 

Check my latest blog post Compare Budgeted Scenarios vs. Actuals I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

View solution in original post

3 REPLIES 3
parry2k
Super User
Super User

@FatBlackCat30 glad it worked out, unfortunately, you marked your own reply as a solution. It doesn't matter but better you mark the actual reply as a solution so that others can take benefit from this solution. Just advice.

 

Check my latest blog post Compare Budgeted Scenarios vs. Actuals I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

parry2k
Super User
Super User

@FatBlackCat30 solution attached, I added multiple measures to understand the solution. You can tweak it as you see fit.

 

Check my latest blog post Compare Budgeted Scenarios vs. Actuals I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

this is perfect thank you very much

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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