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
ADSL
Post Prodigy
Post Prodigy

How to Find the Total of Inventory Count Qty by Each Aging

Hi BI Community Team,

 

I hope you're doing well.

 

I have created the measure below to find the current stock count Qty. But I still don't know how to find the total Qty by each aging as the screenshot.

 

Current Stock Count Qty= CALCULATE([SQ],FILTER(ADDCOLUMNS(CALCULATETABLE(VALUES(Inventory[exp_date]),Inventory[exp_date]<>date(1900,1,2)),"ABCD",CALCULATE([Inventory age],CALCULATETABLE(VALUES(Inventory[exp_date])))),COUNTROWS(FILTER('Aging buckets',[abcd]>='Aging buckets'[Lower]&&[ABCD]<='Aging buckets'[Upper]))>0))
 
May I need your help/suggestion to find the Total Qty Count based on condition below? The condition are:
 
  •  Expired
  • 1-30 days
  • 31-90 days
  • 91-180 days
  • 181-270 days
  • 271-365 days
  • > 365 days

2023-05-26_21-13-34.png

 

Sample pbix file - https://drive.google.com/drive/folders/1Njz0ZX2RzEKntLMwzEB9UvUtgJju_iR6?usp=sharing 

 

Thanks and Regards,

5 REPLIES 5
Ashish_Mathur
Super User
Super User

Hi,

Write this measure and drag it to the 4 card visuals

Measure = SUMX(VALUES(Inventory[Product Name]),[Measure 1])

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Jelena_I_0-1685274705363.png

 

Anonymous
Not applicable

If I understood right, you need only to go to the Format Visuals and Turn "Row Subtotals" on. Than you will get the Totals by the row. 


I hope, it helps. 

 

Best regards,

Jelena

Hi @Anonymous ,

 

For your suggestion, it's referred to Matrix visual that we can turn on. However I turn it on, but it's not correct of total as the screenshot.

 

2023-05-28_19-10-09.png

@ADSL First, please vote for this idea: https://ideas.powerbi.com/ideas/idea/?ideaid=082203f1-594f-4ba7-ac87-bb91096c742e

This looks like a measure totals problem. Very common. See my post about it here: https://community.powerbi.com/t5/DAX-Commands-and-Tips/Dealing-with-Measure-Totals/td-p/63376

Also, this Quick Measure, Measure Totals, The Final Word should get you what you need:
https://community.powerbi.com/t5/Quick-Measures-Gallery/Measure-Totals-The-Final-Word/m-p/547907

Also: https://youtu.be/uXRriTN0cfY
And: https://youtu.be/n4TYhF2ARe8

 

Also: Matrix Measure Total Triple Threat Rock & Roll - Microsoft Fabric Community


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

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.