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
itsmeanuj
Helper IV
Helper IV

Columns in Matrix

Hi,

 

I have a workbook that keeps me updated on the items inventory.  here is the link to download the workbook:

https://drive.google.com/file/d/1tPPybuVuEAiSYy0mjFTCOIVyRDQQpdOS/view?usp=sharing

 

The data is for last 114 weeks, however matrix visual in PBI has a limitation to show only last 100 columns of data. I have a calculated measure -  "Inventory" in the workbook which takes input from columns Dispense and Purchase and shows the current inventory of the items. 

 

Now to showcase the latest week, I have to filter out the initial few weeks since we have a limitation of 100 columns. when I apply the filter on the week to keep last 100 weeks, inventory shows the incorrect values since it gets calculated using only last 100 weeks and not the entire dataset which is 114 weeks. e.g. pencil Inventory in week 3/4/2022 is 95. However, if I put a filter on weeks to exclude whole year 2020, the inventory shows 35 (which is incorrect)

 

Is there a way we can show only last 100 weeks but the inventory calculations takes the entire dataset to showcase the correct number. 

 

1 ACCEPTED SOLUTION
v-zhangti
Community Support
Community Support

Hi, @itsmeanuj 

 

You can reach your needs by changing the filters in the calculation.

Measure:

Inventory = CALCULATE(
	calculate(sum(Sheet1[Purchase]))-calculate(sum(Sheet1[Dispense])),
	FILTER(
		ALL(Sheet1[Week]),
		ISONORAFTER(Sheet1[Week], MAX(Sheet1[Week]), DESC)
	)
)

https://docs.microsoft.com/dax/all-function-dax 

 

The cancellation of partial weeks at this point will not affect the original calculation.

vzhangti_0-1653893121201.png

 

Best Regards,

Community Support Team _Charlotte

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

1 REPLY 1
v-zhangti
Community Support
Community Support

Hi, @itsmeanuj 

 

You can reach your needs by changing the filters in the calculation.

Measure:

Inventory = CALCULATE(
	calculate(sum(Sheet1[Purchase]))-calculate(sum(Sheet1[Dispense])),
	FILTER(
		ALL(Sheet1[Week]),
		ISONORAFTER(Sheet1[Week], MAX(Sheet1[Week]), DESC)
	)
)

https://docs.microsoft.com/dax/all-function-dax 

 

The cancellation of partial weeks at this point will not affect the original calculation.

vzhangti_0-1653893121201.png

 

Best Regards,

Community Support Team _Charlotte

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

 

 

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.