Power BI Reports - Part 3: Cost Management Data and Lab Services Data Together

Published Sep 14 2021 09:00 AM 579 Views
Microsoft

In the first blog post of this series, we used PowerBI to visual data from Cost Management for your labs. In the second, we recorded and displayed information about the labs themselves. 

 

Important! This blog post does build on the previous two parts, so please complete them before proceeding.

To do this, we’ll need to match up information from Lab Services to information from Cost Management.  The goal of this blog post is to create a report that lists cost per student and costs for configuring templates and will look like the following report.  With this report we will also be able to answer questions like “How much did it cost to setup the template machines for a class?” and “Did anyone start an unassigned vm?”

 

planetmaher_0-1631568548777.png

 

 

Since the Cost Management data is historical data, we need to access the historical data for Lab Services information.  Using the most recent Lab Services information (as we did in the part 2 of this blog post series) will cause issues if labs, virtual machines, or users have been deleted. 

 

A word of caution before we proceed-- the lab, virtual machine, and user information will show the most recent total usage for the life of the virtual machine because we get this information directly from Azure Lab Services. The cost data is historical. So, unless you have been exporting your costs from Cost Management since the beginning of the life of the lab, any calculations using both vm usage information and cost management data may show discrepancies.

 

Update the Model

First, we need a table with all the historical vm information from lab services.

We will add a connection, to the storage account and vminfo-dailyexports container from the part 2 of this series.

 

  1. Rename the table to vminfo-historical to help use identify when we are using historical and not most recent data.
  2. Since we are only keeping the historical data, keep only the files that do not equal the ‘vminfo-latest.csv’ file. (The ‘vminfo-latest.csv’ file has the most recent information for lab virtual machines and a duplicate of the the historical version of the data.)
  3. Select combine files.  PowerBI will automatically change data types for the date and duration columns.
  4. Save transformations.

To answer to question “how much am I spending on each student?” we need to correlate the information from dailyexports Cost Management data (as configured in part 1 of this series) to the vminfo-historical Lab Services data.  To do that, let’s create another table that has a list of all the unique vmIds and the correlating usernames and emails.

  1. From Power BI Desktop, select Modeling tab, select New Table.

planetmaher_1-1631568548781.png

 

  1. For the table formula, enter:

 

 

 

 

DistinctHistoricalVmUserInfo = DISTINCT(SELECTCOLUMNS('vminfo-historical', "VmName", [VmName], "VmId", [VmId], "UserName", [UserName], "UserEmail", [UserEmail]))

 

 

 

 

  1. Filter out any rows that have and empty UserEmail.  Rows with empty user emails are virtual machines that have not yet been assigned to a student. From the Data view, select Text filter -> Does not equals…

planetmaher_2-1631568548787.png

On the Text filters window, click OK.  (Leaving the value blank will remove all the rows that are blank for UserEmail.)

planetmaher_3-1631568548788.png

 

Now we have a table that correlates every virtual machine registered and claimed by a student, even if the lab has been deleted.

 

Lastly, we need to tell Power BI about the relationship between our newly created DistinctHistoricalVmUserInfo table and the dailyexports table.  We’ll need to create the relationship manually.

 

  1. From the Model view of Power BI Desktop, select the Home tab, then select Manage Relationships.

planetmaher_4-1631568548790.png

 

  1. Select New… on the Manage Relationships dialog.
  2. Create a relationship between from the ResourceId column of dailyexports table to the VmId column of DistinctHistoricanVmUserInfo table.

planetmaher_5-1631568548797.png

 

In the Model view, the tables should look like:

planetmaher_6-1631568548799.png

Create the data visualizations

With both the lab information and cost data, we can analyze the cost of individual users.  To see how much is spent on each student, we will use a table visualization.  For the table, set the values to

  • ‘DistinctHistoricalVmUserInfo’[UserEmail]
  • the sum of ‘dailyexports’[PreTaxCost]

That’s all we need to do to create our table!  The relationships we set up previously allow use to match the user email to the vm id to the total cost associated with that vm id. 

 

planetmaher_7-1631568548800.png

 

 

planetmaher_8-1631568548800.png

 

Notice the empty line in the first row?  This is the total cost for running any VM not associated with a student like the template VMs.  If someone started an unclaimed student VM, that is included in this total as well. 

 

What if we want more information about this blank line total?  It would be good to know how much templates cost.  Are there unassigned VMs being started by the instructor?  Let’s add that information to this view.

 

It will be useful to know the lab name and if the vm is a template or not in one assigned to a student.  So, let’s add a column to the dailyexports table with that information in one field.

  1. In the Data view of Power BI Desktop, select the dailyexports table.
  2. In the Table Tools ribbon and select New Column.
  3. For the column formula, enter

 

 

 

 

LabAndVMName = CONCATENATE(CONCATENATE(CONCATENATE(dailyexports[LabName], " ("), dailyexports[VmName]), ")")

 

 

 

 

This column will display ‘{lab name} ({virtual machine name})’ for a student VM or ‘{lab name} (template)’ for a template VM.

 

Let’s change the table visualization to a matrix visualization. Set the rows to:

  • ‘DistinctHistoricalVmUserInfo’[UserEmail]
  • ‘dailyexports’[LabAndVMName]

Set the value to:

  • the sum of ‘dailyexports’[PreTaxCost]

 

planetmaher_9-1631568548801.png

 

When I expand the blank line in the matrix, we can see how much configuring the templates costs me.  I can also see that an instructor started one of the student lab VMs that is not assigned to a student. (Note, if an instructor starts a VM after it is assigned to the student, that cost will show under the students name as we are grouping all costs associated with a lab VM to its owner.)

 

planetmaher_10-1631568548802.png

Publish the data

Last step is to publish the report!   See Publish datasets and reports from Power BI Desktop for further instructions.

 

Happing Reporting!

The Lab Services Team

%3CLINGO-SUB%20id%3D%22lingo-sub-2747368%22%20slang%3D%22en-US%22%3EPower%20BI%20Reports%20-%20Part%203%3A%20Cost%20Management%20Data%20and%20Lab%20Services%20Data%20Together%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2747368%22%20slang%3D%22en-US%22%3E%3CP%20class%3D%22p2%22%3EIn%20the%20first%20blog%20post%20of%20this%20series%2C%20we%20used%20PowerBI%20to%20visual%20data%20from%20Cost%20Management%20for%20your%20labs.%20In%20the%20second%2C%20we%20recorded%20and%20displayed%20information%20about%20the%20labs%20themselves.%3CSPAN%20class%3D%22Apple-converted-space%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20class%3D%22p1%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EImportant!%3C%2FSTRONG%3E%20This%20blog%20post%20does%20build%20on%20the%20previous%20two%20parts%2C%20so%20please%20complete%20them%20before%20proceeding.%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fazure-lab-services%2Fpower-bi-reports-for-azure-lab-services-part-1-visualizing-cost%2Fba-p%2F2654238%22%20target%3D%22_blank%22%3EPart%201%3A%20Reporting%20Cost%20Management%20data%20for%20Azure%20Lab%20Services%3C%2FA%3E%3C%2FLI%3E%0A%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fazure-lab-services%2Fpower-bi-reports-for-azure-lab-services-part-2-visualizing-lab%2Fba-p%2F2681993%22%20target%3D%22_blank%22%3EPart%202%3A%20Reporting%20Lab%20Information%20for%20Azure%20Lab%20Services%3C%2FA%3E%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3ETo%20do%20this%2C%20we%E2%80%99ll%20need%20to%20match%20up%20information%20from%20Lab%20Services%20to%20information%20from%20Cost%20Management.%26nbsp%3B%20The%20goal%20of%20this%20blog%20post%20is%20to%20create%20a%20report%20that%20lists%20cost%20per%20student%20and%20costs%20for%20configuring%20templates%20and%20will%20look%20like%20the%20following%20report.%26nbsp%3B%20With%20this%20report%20we%20will%20also%20be%20able%20to%20answer%20questions%20like%20%E2%80%9CHow%20much%20did%20it%20cost%20to%20setup%20the%20template%20machines%20for%20a%20class%3F%E2%80%9D%20and%20%E2%80%9CDid%20anyone%20start%20an%20unassigned%20vm%3F%E2%80%9D%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22planetmaher_0-1631568548777.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F310128i0A02380F049BACAC%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22planetmaher_0-1631568548777.png%22%20alt%3D%22planetmaher_0-1631568548777.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ESince%20the%20Cost%20Management%20data%20is%20historical%20data%2C%20we%20need%20to%20access%20the%20historical%20data%20for%20Lab%20Services%20information.%26nbsp%3B%20Using%20the%20most%20recent%20Lab%20Services%20information%20(as%20we%20did%20in%20the%20part%202%20of%20this%20blog%20post%20series)%20will%20cause%20issues%20if%20labs%2C%20virtual%20machines%2C%20or%20users%20have%20been%20deleted.%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EA%20word%20of%20caution%20before%20we%20proceed--%20the%20lab%2C%20virtual%20machine%2C%20and%20user%20information%20will%20show%20the%20most%20recent%20total%20usage%20for%20the%20life%20of%20the%20virtual%20machine%20because%20we%20get%20this%20information%20directly%20from%20Azure%20Lab%20Services.%20The%20cost%20data%20is%20historical.%20So%2C%20%3CEM%3Eunless%20you%20have%20been%20exporting%20your%20costs%20from%20Cost%20Management%20since%20the%20beginning%20of%20the%20life%20of%20the%20lab%2C%20any%20calculations%20using%20both%20vm%20usage%20information%20and%20cost%20management%20data%20may%20show%20discrepancies.%3C%2FEM%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH1%20id%3D%22toc-hId-1443669260%22%20id%3D%22toc-hId-1443734601%22%3EUpdate%20the%20Model%3C%2FH1%3E%0A%3CP%3EFirst%2C%20we%20need%20a%20table%20with%20all%20the%20historical%20vm%20information%20from%20lab%20services.%3C%2FP%3E%0A%3CP%3EWe%20will%20add%20a%20connection%2C%20to%20the%20storage%20account%20and%20%3CSTRONG%3Evminfo-dailyexports%3C%2FSTRONG%3E%20container%20from%20the%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fazure-lab-services%2Fpower-bi-reports-for-azure-lab-services-part-2-visualizing-lab%2Fba-p%2F2681993%22%20target%3D%22_blank%22%3Epart%202%3C%2FA%3E%20of%20this%20series.%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3E%26nbsp%3B%3C%2FSTRONG%3E%3C%2FP%3E%0A%3COL%3E%0A%3CLI%3ERename%20the%20table%20to%20%3CSTRONG%3Evminfo-historical%3C%2FSTRONG%3E%20to%20help%20use%20identify%20when%20we%20are%20using%20historical%20and%20not%20most%20recent%20data.%3C%2FLI%3E%0A%3CLI%3ESince%20we%20are%20only%20keeping%20the%20historical%20data%2C%20keep%20only%20the%20files%20that%26nbsp%3B%3CEM%3Edo%20not%20equal%3C%2FEM%3E%26nbsp%3Bthe%20%E2%80%98%3CSTRONG%3Evminfo-latest.csv%3C%2FSTRONG%3E%E2%80%99%20file.%26nbsp%3B(The%20%E2%80%98vminfo-latest.csv%E2%80%99%20file%20has%20the%20most%20recent%20information%20for%20lab%20virtual%20machines%20and%20a%20duplicate%20of%20the%20the%20historical%20version%20of%20the%20data.)%3C%2FLI%3E%0A%3CLI%3ESelect%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fpower-bi%2Ftransform-model%2Fdesktop-combine-binaries%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ecombine%20files%3C%2FA%3E.%26nbsp%3B%20PowerBI%20will%20automatically%20change%20data%20types%20for%20the%20date%20and%20duration%20columns.%3C%2FLI%3E%0A%3CLI%3ESave%20transformations.%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3ETo%20answer%20to%20question%20%E2%80%9Chow%20much%20am%20I%20spending%20on%20each%20student%3F%E2%80%9D%20we%20need%20to%20correlate%20the%20information%20from%20%3CSTRONG%3Edailyexports%3C%2FSTRONG%3E%20Cost%20Management%20data%20(as%20configured%20in%20part%201%20of%20this%20series)%20to%20the%20%3CSTRONG%3Evminfo-historical%3C%2FSTRONG%3E%20Lab%20Services%20data.%26nbsp%3B%20To%20do%20that%2C%20let%E2%80%99s%20create%20another%20table%20that%20has%20a%20list%20of%20all%20the%20unique%20vmIds%20and%20the%20correlating%20usernames%20and%20emails.%3C%2FP%3E%0A%3COL%3E%0A%3CLI%3EFrom%20Power%20BI%20Desktop%2C%20select%20%3CSTRONG%3EModeling%3C%2FSTRONG%3E%20tab%2C%20select%20%3CSTRONG%3ENew%20Table%3C%2FSTRONG%3E.%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22planetmaher_1-1631568548781.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F310129i980A97AAC4AA16F9%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22planetmaher_1-1631568548781.png%22%20alt%3D%22planetmaher_1-1631568548781.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3COL%20start%3D%222%22%3E%0A%3CLI%3EFor%20the%20table%20formula%2C%20enter%3A%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-powerquery%22%3E%3CCODE%3EDistinctHistoricalVmUserInfo%20%3D%20DISTINCT(SELECTCOLUMNS('vminfo-historical'%2C%20%22VmName%22%2C%20%5BVmName%5D%2C%20%22VmId%22%2C%20%5BVmId%5D%2C%20%22UserName%22%2C%20%5BUserName%5D%2C%20%22UserEmail%22%2C%20%5BUserEmail%5D))%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3COL%20start%3D%223%22%3E%0A%3CLI%3EFilter%20out%20any%20rows%20that%20have%20and%20empty%20%3CSTRONG%3EUserEmail%3C%2FSTRONG%3E.%26nbsp%3B%20Rows%20with%20empty%20user%20emails%20are%20virtual%20machines%20that%20have%20not%20yet%20been%20assigned%20to%20a%20student.%20From%20the%20%3CSTRONG%3EData%3C%2FSTRONG%3E%20view%2C%20select%20%3CSTRONG%3EText%20filter%3C%2FSTRONG%3E%20-%26gt%3B%20%3CSTRONG%3EDoes%20not%20equals%E2%80%A6%3C%2FSTRONG%3E%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22planetmaher_2-1631568548787.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F310130i18E8A3476A6C5670%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22planetmaher_2-1631568548787.png%22%20alt%3D%22planetmaher_2-1631568548787.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EOn%20the%20%3CSTRONG%3EText%20filters%20%3C%2FSTRONG%3Ewindow%2C%20click%20%3CSTRONG%3EOK%3C%2FSTRONG%3E.%26nbsp%3B%20(Leaving%20the%20value%20blank%20will%20remove%20all%20the%20rows%20that%20are%20blank%20for%20%3CSTRONG%3EUserEmail%3C%2FSTRONG%3E.)%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22planetmaher_3-1631568548788.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F310131iAB5A0890A91CC8CB%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22planetmaher_3-1631568548788.png%22%20alt%3D%22planetmaher_3-1631568548788.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ENow%20we%20have%20a%20table%20that%20correlates%20every%20virtual%20machine%20registered%20and%20claimed%20by%20a%20student%2C%20even%20if%20the%20lab%20has%20been%20deleted.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ELastly%2C%20we%20need%20to%20tell%20Power%20BI%20about%20the%20relationship%20between%20our%20newly%20created%20%3CSTRONG%3EDistinctHistoricalVmUserInfo%3C%2FSTRONG%3E%20table%20and%20the%20%3CSTRONG%3Edailyexports%3C%2FSTRONG%3E%20table.%26nbsp%3B%20We%E2%80%99ll%20need%20to%20create%20the%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fpower-bi%2Ftransform-model%2Fdesktop-create-and-manage-relationships%23create-a-relationship-manually%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Erelationship%20manually%3C%2FA%3E.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3COL%3E%0A%3CLI%3EFrom%20the%20%3CSTRONG%3EModel%3C%2FSTRONG%3E%20view%20of%20Power%20BI%20Desktop%2C%20select%20the%20%3CSTRONG%3EHome%3C%2FSTRONG%3E%20tab%2C%20then%20select%20%3CSTRONG%3EManage%20Relationships%3C%2FSTRONG%3E.%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22planetmaher_4-1631568548790.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F310132i8ADAE0994921CF15%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22planetmaher_4-1631568548790.png%22%20alt%3D%22planetmaher_4-1631568548790.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3COL%20start%3D%222%22%3E%0A%3CLI%3ESelect%20%3CSTRONG%3ENew%E2%80%A6%3C%2FSTRONG%3E%20on%20the%20%3CSTRONG%3EManage%20Relationships%3C%2FSTRONG%3E%20dialog.%3C%2FLI%3E%0A%3CLI%3ECreate%20a%20relationship%20between%20from%20the%20%3CSTRONG%3EResourceId%20%3C%2FSTRONG%3Ecolumn%20of%20%3CSTRONG%3Edailyexports%3C%2FSTRONG%3E%20table%20to%20the%20%3CSTRONG%3EVmId%3C%2FSTRONG%3E%20column%20of%20%3CSTRONG%3EDistinctHistoricanVmUserInfo%3C%2FSTRONG%3E%20table%3CSTRONG%3E.%3C%2FSTRONG%3E%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22planetmaher_5-1631568548797.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F310133i77DD12B84EB64D9C%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22planetmaher_5-1631568548797.png%22%20alt%3D%22planetmaher_5-1631568548797.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIn%20the%20%3CSTRONG%3EModel%3C%2FSTRONG%3E%20view%2C%20the%20tables%20should%20look%20like%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22planetmaher_6-1631568548799.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F310134i6F0FBD76EAE4EB8C%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22planetmaher_6-1631568548799.png%22%20alt%3D%22planetmaher_6-1631568548799.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CH1%20id%3D%22toc-hId--363785203%22%20id%3D%22toc-hId--363719862%22%3ECreate%20the%20data%20visualizations%3C%2FH1%3E%0A%3CP%3EWith%20both%20the%20lab%20information%20and%20cost%20data%2C%20we%20can%20analyze%20the%20cost%20of%20individual%20users.%26nbsp%3B%20To%20see%20how%20much%20is%20spent%20on%20each%20student%2C%20we%20will%20use%20a%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fpower-bi%2Fvisuals%2Fpower-bi-visualization-tables%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Etable%20visualization%3C%2FA%3E.%26nbsp%3B%20For%20the%20table%2C%20set%20the%20values%20to%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3E%E2%80%98DistinctHistoricalVmUserInfo%E2%80%99%5BUserEmail%5D%3C%2FLI%3E%0A%3CLI%3Ethe%20sum%20of%20%E2%80%98dailyexports%E2%80%99%5BPreTaxCost%5D%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3EThat%E2%80%99s%20all%20we%20need%20to%20do%20to%20create%20our%20table!%26nbsp%3B%20The%20relationships%20we%20set%20up%20previously%20allow%20use%20to%20match%20the%20user%20email%20to%20the%20vm%20id%20to%20the%20total%20cost%20associated%20with%20that%20vm%20id.%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22planetmaher_7-1631568548800.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F310135iC759A285A76B2F58%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22planetmaher_7-1631568548800.png%22%20alt%3D%22planetmaher_7-1631568548800.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22planetmaher_8-1631568548800.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F310136iBB502CC72C33974F%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22planetmaher_8-1631568548800.png%22%20alt%3D%22planetmaher_8-1631568548800.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ENotice%20the%20empty%20line%20in%20the%20first%20row%3F%26nbsp%3B%20This%20is%20the%20total%20cost%20for%20running%20any%20VM%20not%20associated%20with%20a%20student%20like%20the%20template%20VMs.%26nbsp%3B%20If%20someone%20started%20an%20unclaimed%20student%20VM%2C%20that%20is%20included%20in%20this%20total%20as%20well.%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWhat%20if%20we%20want%20more%20information%20about%20this%20blank%20line%20total%3F%26nbsp%3B%20It%20would%20be%20good%20to%20know%20how%20much%20templates%20cost.%26nbsp%3B%20Are%20there%20unassigned%20VMs%20being%20started%20by%20the%20instructor%3F%26nbsp%3B%20Let%E2%80%99s%20add%20that%20information%20to%20this%20view.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIt%20will%20be%20useful%20to%20know%20the%20lab%20name%20and%20if%20the%20vm%20is%20a%20template%20or%20not%20in%20one%20assigned%20to%20a%20student.%26nbsp%3B%20So%2C%20let%E2%80%99s%20add%20a%20column%20to%20the%20%3CSTRONG%3Edailyexports%3C%2FSTRONG%3E%20table%20with%20that%20information%20in%20one%20field.%3C%2FP%3E%0A%3COL%3E%0A%3CLI%3EIn%20the%20%3CSTRONG%3EData%3C%2FSTRONG%3E%20view%20of%20Power%20BI%20Desktop%2C%20select%20the%20%3CSTRONG%3Edailyexports%3C%2FSTRONG%3E%20table.%3C%2FLI%3E%0A%3CLI%3EIn%20the%20%3CSTRONG%3ETable%20Tools%3C%2FSTRONG%3E%20ribbon%20and%20select%20%3CSTRONG%3ENew%20Column%3C%2FSTRONG%3E.%3C%2FLI%3E%0A%3CLI%3EFor%20the%20column%20formula%2C%20enter%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-powerquery%22%3E%3CCODE%3ELabAndVMName%20%3D%20CONCATENATE(CONCATENATE(CONCATENATE(dailyexports%5BLabName%5D%2C%20%22%20(%22)%2C%20dailyexports%5BVmName%5D)%2C%20%22)%22)%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThis%20column%20will%20display%20%E2%80%98%7Blab%20name%7D%20(%7Bvirtual%20machine%20name%7D)%E2%80%99%20for%20a%20student%20VM%20or%20%E2%80%98%7Blab%20name%7D%20(template)%E2%80%99%20for%20a%20template%20VM.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ELet%E2%80%99s%20change%20the%20table%20visualization%20to%20a%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fpower-bi%2Fvisuals%2Fdesktop-matrix-visual%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ematrix%20visualization%3C%2FA%3E.%20Set%20the%20rows%20to%3A%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3E%E2%80%98DistinctHistoricalVmUserInfo%E2%80%99%5BUserEmail%5D%3C%2FLI%3E%0A%3CLI%3E%E2%80%98dailyexports%E2%80%99%5BLabAndVMName%5D%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3ESet%20the%20value%20to%3A%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3Ethe%20sum%20of%20%E2%80%98dailyexports%E2%80%99%5BPreTaxCost%5D%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22planetmaher_9-1631568548801.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F310137iBE84984A61DEF5DC%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22planetmaher_9-1631568548801.png%22%20alt%3D%22planetmaher_9-1631568548801.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWhen%20I%20expand%20the%20blank%20line%20in%20the%20matrix%2C%20we%20can%20see%20how%20much%20configuring%20the%20templates%20costs%20me.%26nbsp%3B%20I%20can%20also%20see%20that%20an%20instructor%20started%20one%20of%20the%20student%20lab%20VMs%20that%20is%20not%20assigned%20to%20a%20student.%20(Note%2C%20if%20an%20instructor%20starts%20a%20VM%20after%20it%20is%20assigned%20to%20the%20student%2C%20that%20cost%20will%20show%20under%20the%20students%20name%20as%20we%20are%20grouping%20all%20costs%20associated%20with%20a%20lab%20VM%20to%20its%20owner.)%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22planetmaher_10-1631568548802.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F310138i353956996D375010%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22planetmaher_10-1631568548802.png%22%20alt%3D%22planetmaher_10-1631568548802.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CH1%20id%3D%22toc-hId-2123727630%22%20id%3D%22toc-hId-2123792971%22%3EPublish%20the%20data%3C%2FH1%3E%0A%3CP%3ELast%20step%20is%20to%20publish%20the%20report!%26nbsp%3B%26nbsp%3B%20See%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fpower-bi%2Fcreate-reports%2Fdesktop-upload-desktop-files%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EPublish%20datasets%20and%20reports%20from%20Power%20BI%20Desktop%3C%2FA%3E%20for%20further%20instructions.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EHapping%20Reporting!%3C%2FP%3E%0A%3CP%3EThe%20Lab%20Services%20Team%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-2747368%22%20slang%3D%22en-US%22%3E%3CP%3EIn%20the%20first%20part%20of%20this%20series%2C%20we%20used%20PowerBI%20to%20visual%20data%20from%20Cost%20Management%20for%20your%20labs.%26nbsp%3B%20In%20the%20second%2C%20we%20recorded%20and%20displayed%20information%20about%20the%20labs%20themselves.%26nbsp%3B%20Now%2C%26nbsp%3Bit%E2%80%99s%20time%20to%20pull%20it%20all%20together.%20In%20this%20blog%20post%2C%20we%E2%80%99ll%20show%20you%20how%20to%20answer%20the%20question%2C%20%E2%80%9Chow%20much%20am%20I%20spending%20for%20each%20student%3F%22%3C%2FP%3E%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2747368%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3ELab%20Services%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Co-Authors
Version history
Last update:
‎Sep 14 2021 09:37 PM
Updated by: