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
prabhatnath
Advocate III
Advocate III

How to get Direct Values in Column Chart instead of Aggregated values

I have the following 2 tables and wanted help to have a chart done as below from the 2 tables in PBI Desktop.

 

The below chart I did in Excel, and wanted to get it done in PBI. I make a Pivot Table from Table-2 and then added another column and did a VLookup to pull the Capacity value from Table-1 and then did a Chart.


Another way we can do this in Excel is to add a new column to Table-1 and get the Sum of the Consumed Value for each Work Id from Table-2 (SUM based on Filter) and do a chart from Table-1. 

 

prabhatnath_0-1683887154908.png

 

Table-1

ProgramWorkIdCapacity
P1W125
P1W220
P1W328

 

Table-2

JobIdWorkIdConsumed
101W110
102W14
103W18
104W212
105W212
106W315
107W310


Thanks,
Prabhat

2 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

@prabhatnath , create a common table work id and join with both tables and use that in visual

 

workid= distinct(union(distinct(Table1[workid]),distinct(Table2[workid])))

 

Sum of consumed and capacity with common dimension in visual will do

 

Power BI- DAX: When I asked you to create common tables: https://youtu.be/a2CrqCA9geM
https://medium.com/@amitchandak/power-bi-when-i-asked-you-to-create-common-tables-a-quick-dax-soluti...

View solution in original post

v-binbinyu-msft
Community Support
Community Support

Hi @prabhatnath ,

Please try below steps:

1. create a new table with below dax formula

Table3 = DISTINCT(UNION(VALUES(Table1[WorkId]),VALUES(Table2[WorkId])))

vbinbinyumsft_0-1684216356311.png

2. create two measure with below dax formula

Measure =
VAR _id =
    SELECTEDVALUE ( Table3[WorkId] )
VAR tmp1 =
    FILTER ( ALL ( Table1 ), [WorkId] = _id )
RETURN
    SUMX ( tmp1, [Capacity] )
Measure2 =
VAR _id =
    SELECTEDVALUE ( Table3[WorkId] )
VAR tmp1 =
    FILTER ( ALL ( Table2 ), [WorkId] = _id )
RETURN
    SUMX ( tmp1, [Consumed] )

3. add a clustered column chart with Table3 filed and measure

vbinbinyumsft_1-1684216518013.png

Please refer the attached .pbix file.

 

Best regards,
Community Support Team_Binbin Yu
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

3 REPLIES 3
prabhatnath
Advocate III
Advocate III

@amitchandak and @v-binbinyu-msft thanks for the reply on this and the reply helped me. I can select just one as a Solution I believe.  

v-binbinyu-msft
Community Support
Community Support

Hi @prabhatnath ,

Please try below steps:

1. create a new table with below dax formula

Table3 = DISTINCT(UNION(VALUES(Table1[WorkId]),VALUES(Table2[WorkId])))

vbinbinyumsft_0-1684216356311.png

2. create two measure with below dax formula

Measure =
VAR _id =
    SELECTEDVALUE ( Table3[WorkId] )
VAR tmp1 =
    FILTER ( ALL ( Table1 ), [WorkId] = _id )
RETURN
    SUMX ( tmp1, [Capacity] )
Measure2 =
VAR _id =
    SELECTEDVALUE ( Table3[WorkId] )
VAR tmp1 =
    FILTER ( ALL ( Table2 ), [WorkId] = _id )
RETURN
    SUMX ( tmp1, [Consumed] )

3. add a clustered column chart with Table3 filed and measure

vbinbinyumsft_1-1684216518013.png

Please refer the attached .pbix file.

 

Best regards,
Community Support Team_Binbin Yu
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

@prabhatnath , create a common table work id and join with both tables and use that in visual

 

workid= distinct(union(distinct(Table1[workid]),distinct(Table2[workid])))

 

Sum of consumed and capacity with common dimension in visual will do

 

Power BI- DAX: When I asked you to create common tables: https://youtu.be/a2CrqCA9geM
https://medium.com/@amitchandak/power-bi-when-i-asked-you-to-create-common-tables-a-quick-dax-soluti...

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.