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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
Anonymous
Not applicable

How to convert/show monthly margin from single row of data with a given start and end date?

I have the below data and want to create a table and graphs to show billings/margin made each day, month, quarter, year by Consultant but the data is in one row I have a mental block on how to translate it to get what I need. PLLLLEEASSE HELPP!

 

start_dateend_dateoutcomerate1_paymentrate1_invoicedays_per_weekConsultant 1 %Consultant 2 %Number of daysTotal No of days workingDaily MarginCon1 daily MarginCons2 daily margin Cons 1 Total Margin of Contract  Cons 1 Total Margin to Date  Cons 2 Total Margin of Contract  Cons 2 Total Margin to Date 
06/03/201715/04/2017F313001857.1450.90.14040557.14501.42655.714 £ 20,057.04 £ 19,555.61 £   2,228.56 £      2,172.85
11/04/201601/06/2017F3650747.1350.50.541641697.1348.56548.565 £ 20,203.04 £ 17,871.92 £ 20,203.04 £   17,871.92
11/04/201623/05/2016 650747.5   42097.500 £                -   £                -   £                -   £                  -  
14/11/201623/01/2017F2650812.55  7070162.500 £                -   £                -   £                -   £                  -  
05/04/201724/04/2017F3650866.6751 1919216.67216.670 £   4,116.73 £   1,950.03 £                -   £                  -  
28/02/201703/03/2017F36007503 10031.815009000 £                -   £                -   £ 16,200.00 £ 405,000.00

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous,

In Query Editor of Power BI Desktop, add a custom column with the formula below.

{ Number.From([start_date])..Number.From([end_date]) }

Then expand the custom column and format its type to “Date”, for more details, please review the following screenshots. This way, you will get your expected result.
1.PNG2.PNG4.PNG

 

Thanks,
Lydia Zhang

View solution in original post

5 REPLIES 5
Anonymous
Not applicable

Hi @Anonymous,

Could you please post expected result in table? I am not quite sure which logic you use to calculate billings/margin made each day, month, quarter, year by Consultant.

Thanks,
Lydia Zhang

Anonymous
Not applicable

Taking a line in original table, I guess to get it so that when I visualise I can drill down from year, quarter, month, day for any given contract.

 

 

start_dateend_dateoutcomerate1_paymentrate1_invoicedays_per_weekConsultant 1 %Consultant 2 %Number of daysDaily MarginCon1 daily MarginCons2 daily marginTotal No of days working 
06/03/201715/04/2017F313001857.1440.90.1921501351573.6 
              
To something like this;            
Dates in Contractstart_dateend_dateoutcomerate1_paymentrate1_invoicedays_per_weekConsultant 1 %Consultant 2 %Number of daysDaily MarginCon1 daily MarginCons2 daily marginTotal No of days working
06/03/201706/03/201715/04/2017F313001857.1440.90.1921501351573.6
07/03/201706/03/201715/04/2017F313001857.1440.90.1921501351573.6
08/03/201706/03/201715/04/2017F313001857.1440.90.1921501351573.6
09/03/201706/03/201715/04/2017F313001857.1440.90.1921501351573.6
10/03/201706/03/201715/04/2017F313001857.1440.90.1921501351573.6
11/03/201706/03/201715/04/2017F313001857.1440.90.1921501351573.6
12/03/201706/03/201715/04/2017F313001857.1440.90.1921501351573.6
13/03/201706/03/201715/04/2017F313001857.1440.90.1921501351573.6
14/03/201706/03/201715/04/2017F313001857.1440.90.1921501351573.6
15/03/201706/03/201715/04/2017F313001857.1440.90.1921501351573.6
continued to the end date….            

 

Anonymous
Not applicable

Hi @Anonymous,

In Query Editor of Power BI Desktop, add a custom column with the formula below.

{ Number.From([start_date])..Number.From([end_date]) }

Then expand the custom column and format its type to “Date”, for more details, please review the following screenshots. This way, you will get your expected result.
1.PNG2.PNG4.PNG

 

Thanks,
Lydia Zhang

Greg_Deckler
Community Champion
Community Champion

Take a look at this recent thread. Your data format looks similar in format and you probably need to do similar things to unpivot the data.

 

https://community.powerbi.com/t5/Desktop/M-Language-unpivot-issue/m-p/159158

 



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!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

Thank you so much for the response. I can see what you are getting at but can't seem to get my head around how I get the start and end dates unpivoted and showing every date inbetween the start & end repeating all the other information that I can then present/report over periods? 

 

 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors