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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Ruthwiksai_2021
Frequent Visitor

Dax for below requirement

i have requirement like this 

create a 'consumption rate' metric, which takes into consideration order size and frequency.

  • Example: doctor office purchases 4 cases, and then the following month purchases 8 cases. This implies they have used 4 cases / month, and so their reorder would last for two months

Thanks

2 REPLIES 2
v-yiruan-msft
Community Support
Community Support

Hi @Ruthwiksai_2021 ,

In order to provide you a suitable solution, could you please share some sample data in your tables(exclude sensitive data) and your expected result with backend logic and special examples. Thank you.

1. Sample data

Col1 Col2 Col3
xx xx xx
xx xx xx

2. Calculation logic

consumption rate=(number of cases)/(count of months in selected date period)?

3. Expected result with special examples

Col1 Col2 consumption rate
xx xx ?
xx xx ?

Best Regards

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
amitchandak
Super User
Super User

@Ruthwiksai_2021 , It would like

divide( count(table[Cases]), distinctcount(Table[Year Month]))

 

If this does not help
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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