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

Create custom Table from different sources

Hi all,

I'm trying to show a table with some calculations of different sources and I would like to know what's the best approach to achieve that. I will try to sum up as much as possible. 

The table I want to get is something like that:

USER_X

ConceptObjectiveWeightCurrent total% AchievedWeight 
Billing Area 10401638.20.25510221.370.2
Billing Area 20263342.160.151876770.710
Billing Area 30324437.640.153707851.140.15
Total Area 10150.2120.800
Total Area 20120.15131.080.15
Total Area 30100.15111.100.15
    Total weight0.65

 

My current model is:

Objectives_table:

Person_id : key
Year
Billing_10_obj

Billing_20_obj

Billing_30_obj

Billing_10_weight

Billing_20_weight

Billing_30_weight

Total_10_obj

Total_20_obj

Total_30_obj

Total_10_weight

Total_20_weight

Total_30_weight

 

Bills:
Person_id

Date

Area

Amount

 

Current total 10 = Sum of all bills amount from that person_id with area = 10

Total 10 = Count all bills from that person_id with area = 10

 

I will add some examples if the explanations isn't clear enough.

 

Thanks in advance!

1 ACCEPTED SOLUTION

@mdelasheras

Please check the following PBIX file.
https://1drv.ms/u/s!AhsotbnGu1NokzIAFEf6n2vq99BP

Regards,
Lydia

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

View solution in original post

5 REPLIES 5
v-yuezhe-msft
Employee
Employee

@mdelasheras,

An idea is to unpivot columns in your Objectives_table, then merge the Objectives_table and Bills table. 

In order for use to provide you detailed steps, please share sample data of your Objectives_table and Bills table, then post expected result based on the sample data.


Regards,
Lydia

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

Thanks @v-yuezhe-msft! I will add a detailed sample.


Objectives_table:

Person_idYearBilling_10_objBilling_20_objBilling_30_objBilling_10_weightBilling_20_weightBilling_30_weightTotal_10_objTotal_20_objTotal_30_objTotal_10_weightTotal_20_weightTotal_30_weight
120183333002020001212100.50.10.18650.10.10.5
2201814400080000500000.20.150.151230.20.150.15
320182200002220002222000.60.40.33420.40.050.05

 

Bills_table:

Person_idDateAreaAmount
109/01/201830684641
118/04/20183046465
214/03/20171044100
227/02/20181089620
218/04/20182047512
218/04/20183015687
229/03/20183051510
322/01/20181014541
316/04/20182054981

 

Expected result for person_id = 2 and year = 2018:

ConceptObjectiveWeightCurrent total% Achieved (current/obj)Weight reached*
Billing Area 101440000.2896200.620
Billing Area 20800000.15475120.590
Billing Area 30500000.15671971.340.15
Total Bills Area 1010.211.000.2
Total Bills Area 2020.1510.500
Total Bills Area 3030.1520.670
    Total weight0.35

 

* Weight reached is 0 if % < 1, otherwise is weight


Many thanks!

 

 

@mdelasheras

Please check the following PBIX file.
https://1drv.ms/u/s!AhsotbnGu1NokzIAFEf6n2vq99BP

Regards,
Lydia

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

File is currently not available in one drive. Can you please share the same.

Very clear, thank you so much Lydia!

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.