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

Complicated scenario - best practice advice needed

I have a situation where we are delivered a monthly sales report each morning.  In the report there is a start date and and end date column.  Most records are "daily" where the start date and end date are the same.  If I did a datediff the result would be zero (0). There are some, however, where the start date and end date span more than one, so datediff > 0.   If this happens, what I need to do is to add rows for each day (if the datediff is 3 then it would add three rows) and in those rows DIVIDE the sale amount by that number.  I would post a sample of the data, but this is PHI (HIPAA) data.  

 

An example would be:  the start date is 10/01/2023 and the end date is 10/04/2023.  DateDiff (or actually I am using = Table.AddColumn(#"Changed Type1", "DayDiff", each Duration.Days([Service Thru Date]-[Service From Date]))  The difference is 3.  If the billable total for those three days is $900, I need three rows generated - one for each date and then the billable total for each of those rows would be $300.  So $900/3 days = $300.

 

Is this possible through the PowerBI report, or through Power Query?

 

Thanks for the information

2 REPLIES 2
v-tangjie-msft
Community Support
Community Support

Hi @guyatisk ,

 

My suggestion is through Power Query.

Please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.

 

Best Regards,

Neeko Tang

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

Here it is in plain text form.  For some reason my replies have been going away 

 

Individual Case # Service From Date Service Thru Date Provider ID Units Potential Charges Date Added Claim Detail ID AP Batch # Batch Status Upload File ID Claim Number Allowed Units Allowed Amount Paid Amount Claim Level Adjustment COB Paid Amount Encounter Claim Number Encounter Claim Detail Number Override? Recon? Submission Date Adjudication Date Check Date
00091466 10/25/2022 10/25/2022 2449 4.000 $244.28 10/26/2022 17152 188 Paid / Sent to GL 2439 4.000 $244.28 $244.28 N N 10/27/2022 10/27/2022
00091466 10/31/2022 10/31/2022 1289 1.000 $9.98 10/31/2022 33914 239 Paid / Sent to GL 14697 1.000 $9.98 $9.98 28130 62373 N N 10/31/2022 10/31/2022 2022-11-10
00057051 10/1/2022 10/9/2022 1998 9.000 $451.80 10/11/2022 1807 25 Paid / Sent to GL 357 9.000 $451.80 $451.80 22419 42962 N N 10/11/2022 10/11/2022 2022-10-28
00057051 10/1/2022 10/9/2022 1998 9.000 $484.29 10/11/2022 1791 24 Paid / Sent to GL 355 9.000 $484.29 $484.29 22418 42961 N N 10/11/2022 10/11/2022 2022-10-28
00004460 10/25/2022 10/25/2022 2429 10.000 $610.70 11/4/2022 49015 301 Paid / Sent to GL 23346 10.000 $610.70 $610.70 N N 11/9/2022 11/10/2022
00004460 10/28/2022 10/28/2022 2429 2.000 $122.14 11/4/2022 49143 301 Paid / Sent to GL 23362 2.000 $122.14 $122.14 N N 11/9/2022 11/10/2022
00004460 10/28/2022 10/28/2022 2429 4.000 $244.28 11/4/2022 49039 301 Paid / Sent to GL 23349 4.000 $244.28 $244.28 N N 11/9/2022 11/10/2022



EXPECTED RESULT
00091466 10/25/2022 10/25/2022 2449 4.000 $244.28 10/26/2022 17152 188 Paid / Sent to GL 2439 4.000 $244.28 $244.28 N N 10/27/2022 10/27/2022
00091466 10/31/2022 10/31/2022 1289 1.000 $9.98 10/31/2022 33914 239 Paid / Sent to GL 14697 1.000 $9.98 $9.98 28130 62373 N N 10/31/2022 10/31/2022 2022-11-10
00057051 10/1/2022 10/1/2022 1998 9.000 $56.48 10/11/2022 1807 25 Paid / Sent to GL 357 9.000 $56.48 $56.48 22419 42962 N N 10/11/2022 10/11/2022 2022-10-28
00057051 10/2/2022 10/2/2022 1998 9.000 $56.48 10/11/2022 1807 25 Paid / Sent to GL 357 9.000 $56.48 $56.48 22419 42962 N N 10/11/2022 10/11/2022 2022-10-28
00057051 10/3/2022 10/3/2022 1998 9.000 $56.48 10/11/2022 1807 25 Paid / Sent to GL 357 9.000 $56.48 $56.48 22419 42962 N N 10/11/2022 10/11/2022 2022-10-28
00057051 10/4/2022 10/4/2022 1998 9.000 $56.48 10/11/2022 1807 25 Paid / Sent to GL 357 9.000 $56.48 $56.48 22419 42962 N N 10/11/2022 10/11/2022 2022-10-28
00057051 10/5/2022 10/5/2022 1998 9.000 $56.48 10/11/2022 1807 25 Paid / Sent to GL 357 9.000 $56.48 $56.48 22419 42962 N N 10/11/2022 10/11/2022 2022-10-28
00057051 10/6/2022 10/6/2022 1998 9.000 $56.48 10/11/2022 1807 25 Paid / Sent to GL 357 9.000 $56.48 $56.48 22419 42962 N N 10/11/2022 10/11/2022 2022-10-28
00057051 10/7/2022 10/7/2022 1998 9.000 $56.48 10/11/2022 1807 25 Paid / Sent to GL 357 9.000 $56.48 $56.48 22419 42962 N N 10/11/2022 10/11/2022 2022-10-28
00057051 10/8/2022 10/8/2022 1998 9.000 $56.48 10/11/2022 1807 25 Paid / Sent to GL 357 9.000 $56.48 $56.48 22419 42962 N N 10/11/2022 10/11/2022 2022-10-28
00057051 10/1/2022 10/1/2022 1998 9.000 $60.54 10/11/2022 1807 25 Paid / Sent to GL 357 9.000 $56.48 $56.48 22419 42962 N N 10/11/2022 10/11/2022 2022-10-28
00057051 10/2/2022 10/2/2022 1998 9.000 $60.54 10/11/2022 1807 25 Paid / Sent to GL 357 9.000 $56.48 $56.48 22419 42962 N N 10/11/2022 10/11/2022 2022-10-28
00057051 10/3/2022 10/3/2022 1998 9.000 $60.54 10/11/2022 1807 25 Paid / Sent to GL 357 9.000 $56.48 $56.48 22419 42962 N N 10/11/2022 10/11/2022 2022-10-28
00057051 10/4/2022 10/4/2022 1998 9.000 $60.54 10/11/2022 1807 25 Paid / Sent to GL 357 9.000 $56.48 $56.48 22419 42962 N N 10/11/2022 10/11/2022 2022-10-28
00057051 10/5/2022 10/5/2022 1998 9.000 $60.54 10/11/2022 1807 25 Paid / Sent to GL 357 9.000 $56.48 $56.48 22419 42962 N N 10/11/2022 10/11/2022 2022-10-28
00057051 10/6/2022 10/6/2022 1998 9.000 $60.54 10/11/2022 1807 25 Paid / Sent to GL 357 9.000 $56.48 $56.48 22419 42962 N N 10/11/2022 10/11/2022 2022-10-28
00057051 10/7/2022 10/7/2022 1998 9.000 $60.54 10/11/2022 1807 25 Paid / Sent to GL 357 9.000 $56.48 $56.48 22419 42962 N N 10/11/2022 10/11/2022 2022-10-28
00057051 10/8/2022 10/8/2022 1998 9.000 $60.54 10/11/2022 1807 25 Paid / Sent to GL 357 9.000 $56.48 $56.48 22419 42962 N N 10/11/2022 10/11/2022 2022-10-28
00004460 10/25/2022 10/25/2022 2429 10.000 $610.70 11/4/2022 49015 301 Paid / Sent to GL 23346 10.000 $610.70 $610.70 N N 11/9/2022 11/10/2022
00004460 10/28/2022 10/28/2022 2429 2.000 $122.14 11/4/2022 49143 301 Paid / Sent to GL 23362 2.000 $122.14 $122.14 N N 11/9/2022 11/10/2022
00004460 10/28/2022 10/28/2022 2429 4.000 $244.28 11/4/2022 49039 301 Paid / Sent to GL 23349 4.000 $244.28 $244.28 N N 11/9/2022 11/10/2022

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.