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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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.


@ 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!:
The Definitive Guide to Power Query (M)

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.


@ 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!:
The Definitive Guide to Power Query (M)

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?


@ 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!:
The Definitive Guide to Power Query (M)

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
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.

Top Solution Authors