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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
lovishsood1
Helper III
Helper III

Transformation of table

Hi Everyone,

 

This should be my end output:

lovishsood1_0-1699035740789.png

But the Problem is My data is coming out of 100% and Above Output is showing DATA according to Total Hours for that month.

 

I hope I'm able to describe my problem statement.

Current Table : 

lovishsood1_1-1699035874595.png

 

 

Output Table : 

lovishsood1_2-1699035898881.png

 

I want to achieve like this so that I can create the graph as shown above.

You can ignore the Month Column of Output table as I'm okay with using Month Name & Month Number column as it is.

 

I hope my problem is clear.

 

 

I have used this following script in Warehouse to create the table :

 

 

CREATE view dbo.vwGetData
As

WITH cte as
(
SELECT
        Month_Name,
        Month_Number,
        Project_Category,
       
        100.0 * Actual_Hours / NULLIF(SUM(Actual_Hours) OVER (PARTITION BY Month_Name, Month_Number), 0) AS Percentage
    FROM
        [dbo].[TimelogByType]
        )
        select cte.Month_Name,
        cte.Month_Number,
        cte.Project_Category,Sum(cte.Percentage) AS Percentage from cte GROUP by cte.Month_Name,cte.Month_Number,cte.Project_Category;

 

 

 

Can anyone help me out in this to get the desired output?

1 ACCEPTED SOLUTION
pmreis
Most Valuable Professional
Most Valuable Professional

Hi @lovishsood1 

1) Pivot the Category Column, and Select the Actual_Hrs as the Values

2) Add a Total Column

3) Add Custom Columns to calculate the shares

 

Please find here the solution PBIx, check the Power Query for the solution. 

 


Pedro Reis - Data Platform MVP / MCT
Making Power BI and Fabric Simple

If my response resolved your issue, please mark it as a solution to help others find it. If you found it helpful, please consider giving it a kudos. Your feedback is highly appreciated!

Find me at LinkedIn

View solution in original post

2 REPLIES 2
pmreis
Most Valuable Professional
Most Valuable Professional

Hi @lovishsood1 

1) Pivot the Category Column, and Select the Actual_Hrs as the Values

2) Add a Total Column

3) Add Custom Columns to calculate the shares

 

Please find here the solution PBIx, check the Power Query for the solution. 

 


Pedro Reis - Data Platform MVP / MCT
Making Power BI and Fabric Simple

If my response resolved your issue, please mark it as a solution to help others find it. If you found it helpful, please consider giving it a kudos. Your feedback is highly appreciated!

Find me at LinkedIn
lbendlin
Super User
Super User

Please provide sample data (with sensitive information removed) that covers your issue or question completely, in a usable format (not as a screenshot). Leave out anything not related to the issue.
If you are unsure how to do that please refer to https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...
Please show the expected outcome based on the sample data you provided.

If you want to get answers faster please refer to https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.