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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
Anonymous
Not applicable

Percentage by Project and by month

Hello, here is my problem:

 

I would like to display the percentage of time spent on each project over months. This is the result I get when I drag and drop my fields like this:

Capture d’écran 2022-03-09 185250.png

 

 

 

 

 

 

 

However, the problem is that for each category of project I get the percentage compared to the total of ALL the months cumulated. And what I would like to get is the total for all the categories of projects per month, as done ine Excel here:Capture d’écran 2022-03-09 184953.png

 

Can someone help me with a Dax solution (I presume). I have already tried many things with summarize, filter, group by, but nothing gives me this result. Thanks a lot in advance for your answers. 

1 ACCEPTED SOLUTION
v-rzhou-msft
Community Support
Community Support

Hi @Anonymous ,

 

I create a sample to have a test.

Data table:

2.png

Date table is a calculated table by Dax.

Date = ADDCOLUMNS( CALENDARAUTO(),"Month",MONTH([Date]),"MonthName",FORMAT([Date],"MMMM"))

Relationship:

3.png

Measure:

Percentage by Project and by month = 
VAR _TOTAL_PerMonth =
    CALCULATE (
        SUM ( 'Table'[Time spent] ),
        VALUES ( 'Date'[MonthName] ),
        ALL ( 'Table' )
    )
VAR _CURRENTVALUE =
    CALCULATE ( SUM ( 'Table'[Time spent] ) )
RETURN
    DIVIDE ( _CURRENTVALUE, _TOTAL_PerMonth )

Result is as below.

1.png

 

Best Regards,
Rico Zhou

 

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
v-rzhou-msft
Community Support
Community Support

Hi @Anonymous ,

 

I create a sample to have a test.

Data table:

2.png

Date table is a calculated table by Dax.

Date = ADDCOLUMNS( CALENDARAUTO(),"Month",MONTH([Date]),"MonthName",FORMAT([Date],"MMMM"))

Relationship:

3.png

Measure:

Percentage by Project and by month = 
VAR _TOTAL_PerMonth =
    CALCULATE (
        SUM ( 'Table'[Time spent] ),
        VALUES ( 'Date'[MonthName] ),
        ALL ( 'Table' )
    )
VAR _CURRENTVALUE =
    CALCULATE ( SUM ( 'Table'[Time spent] ) )
RETURN
    DIVIDE ( _CURRENTVALUE, _TOTAL_PerMonth )

Result is as below.

1.png

 

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Hi friend!

i saw this response and is exactly what i´ve looking for, i have the same problem.

Now, this works for me, but only when my only filter is the year. When i apply another filter like, product category or more the graph doesn´t work.

Here an example:

Only selected 2022.

JuanVR10_0-1665793626002.png

 

But when i selec 2022, and one Product category it shows this, and not the cumulative to reach the 100%

JuanVR10_1-1665793704414.png

 

I have a calendar table related to the sales, and other table related with the product category.

 

how can i solve this?

 

Thanks!

 

 

Anonymous
Not applicable

It's exactly what I needed. Sorry for the late answer but I was in holiday and not in my work office. Thank you for your contribution !

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

AugPowerBI_Carousel

Power BI Monthly Update - August 2024

Check out the August 2024 Power BI update to learn about new features.

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

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