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
Vinod_P
Helper I
Helper I

Supply vs demand

Below is the sameple data and looking for demand( Count of values in demand date column) & Supply (Count of values in the supply date column) , Looking at a view to compare both counts like 1-1 against the fixed jan to dec month on X-axis.

ID NUMBERPart numberCUSTOMERCUST REQ DATEEST. FORECAST DELIVERY
11Vinod 17/08/202212/01/2023
21Vinod 17/08/202204/05/2023
31Vinod 17/08/202227/01/2023
41Vinod 17/08/202205/04/2023
52Vinod 01/02/202220/01/2023
62Vinod 01/02/202220/01/2023
72Vinod 01/02/202220/01/2023
82Vinod 01/02/202220/01/2023
92Vinod 01/02/202210/03/2023
102Vinod 01/02/202228/02/2023
112Vinod 01/02/202210/03/2023
122Vinod 01/02/202205/04/2023
132Vinod 27/04/202220/01/2023
141Vinod 21/10/202205/04/2023
151Vinod 21/10/202205/04/2023
161Vinod 21/10/202217/04/2023
171Vinod 21/10/202204/05/2023
181Vinod 21/10/202217/04/2023

Expecting outcome is as below

Vinod_P_0-1683034446836.png

 

1 ACCEPTED SOLUTION
v-jianboli-msft
Community Support
Community Support

Hi @Vinod_P ,

 

Please try:

First create a calendar table:

vjianbolimsft_0-1683168491237.png

Then create a matrix visual and apply these measures:

Demand = CALCULATE(COUNT('Table'[Part number]),FILTER('Table',[CUST REQ DATE]<=EOMONTH(MAX('Calendar'[Date]),0)&&[CUST REQ DATE]>EOMONTH(MAX('Calendar'[Date]),-1)))

Supply = CALCULATE(COUNT('Table'[Part number]),FILTER('Table',[EST. FORECAST DELIVERY]<=EOMONTH(MAX('Calendar'[Date]),0)&&[EST. FORECAST DELIVERY]>EOMONTH(MAX('Calendar'[Date]),-1)))

LOB = [Demand]-[Supply]

vjianbolimsft_1-1683168566329.png

Switch values to rows:

vjianbolimsft_2-1683168603480.png

Final output:

vjianbolimsft_3-1683168627597.png

Best Regards,

Jianbo Li

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

View solution in original post

2 REPLIES 2
v-jianboli-msft
Community Support
Community Support

Hi @Vinod_P ,

 

Please try:

First create a calendar table:

vjianbolimsft_0-1683168491237.png

Then create a matrix visual and apply these measures:

Demand = CALCULATE(COUNT('Table'[Part number]),FILTER('Table',[CUST REQ DATE]<=EOMONTH(MAX('Calendar'[Date]),0)&&[CUST REQ DATE]>EOMONTH(MAX('Calendar'[Date]),-1)))

Supply = CALCULATE(COUNT('Table'[Part number]),FILTER('Table',[EST. FORECAST DELIVERY]<=EOMONTH(MAX('Calendar'[Date]),0)&&[EST. FORECAST DELIVERY]>EOMONTH(MAX('Calendar'[Date]),-1)))

LOB = [Demand]-[Supply]

vjianbolimsft_1-1683168566329.png

Switch values to rows:

vjianbolimsft_2-1683168603480.png

Final output:

vjianbolimsft_3-1683168627597.png

Best Regards,

Jianbo Li

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

Hi , 

 

Thanks a lot for the solution. Need one more small add to the below report

 

Want to add Opening stock = previous month closing ,  for the first month it will be "0" 

 

Below screenshot FYR

Vinod_P_0-1684246846949.png

 

Please help

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.