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

Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now

Reply
KGPBI
Regular Visitor

How do I get the value(quantity) of the 1st day of the month

Hi all,

I want to make a measure / calculated column that gives me the value of the stock at the beginning at the month.
Even if there are no posts in that month, he must give a value.

Example: 
1-05-2020 : 245
1-06-2020: 245
1-07-2020: 245
1-08-2020: 214
1-09-2020: 214
1-10-2020: 214
1-11-2020: 223

PostingdateMutationItemnumberQuantity
03-04-20Positive Adjmt.GD00034973
03-04-20Positive Adjmt.GD000349172
05-04-20Negative Adjmt.GD000349-73
05-04-20Positive Adjmt.GD000349172
05-04-20Negative Adjmt.GD000349-172
05-04-20Negative Adjmt.GD000349-172
05-04-20Positive Adjmt.GD000349172
05-04-20Positive Adjmt.GD00034973
24-07-20SaleGD000349-20
31-07-20Negative Adjmt.GD000349-11
05-11-20Positive Adjmt.GD0003499
1 ACCEPTED SOLUTION
Greg_Deckler
Super User
Super User

@KGPBI Right, and I am assuming that output is being generated from the second table posted. So are you just adding up the previous entries prior to the first of each month? That's basically

 

SUMX(FILTER('Table','Table'[Postingdate] < MAX('Table2'[Date]),'Table'[Quantity])

 

You would need a table with your first days of the month (Table2) and put that in a visual with your measure.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

4 REPLIES 4
Greg_Deckler
Super User
Super User

@KGPBI Right, and I am assuming that output is being generated from the second table posted. So are you just adding up the previous entries prior to the first of each month? That's basically

 

SUMX(FILTER('Table','Table'[Postingdate] < MAX('Table2'[Date]),'Table'[Quantity])

 

You would need a table with your first days of the month (Table2) and put that in a visual with your measure.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

Thanks a lot @Greg_Deckler 

Greg_Deckler
Super User
Super User

@KGPBI I'm not quite following. From the example data provided, what is the expected output?



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

Hi @Greg_Deckler 

Thanks for answering my question.
What you see is part of the item ledger entry. I'm trying to get the stock quantity from the beginning of each month.

This is my output i want to see:
1-05-2020 : 245
1-06-2020: 245
1-07-2020: 245
1-08-2020: 214
1-09-2020: 214
1-10-2020: 214
1-11-2020: 223


Helpful resources

Announcements
OCT PBI Update Carousel

Power BI Monthly Update - October 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

October NL Carousel

Fabric Community Update - October 2024

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