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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
rosscortb
Post Patron
Post Patron

how to show a percentage that reduces over time

Hello 

Instead of showing the percetage by month, how do I show, for example Jan at 100% and the Feb at 90%....?

 

Thanks

Ross

%.PNG

 

1 ACCEPTED SOLUTION

@rosscortb ,

 

Create two calculate columns and a measure using dax as below:

 

Calculate Columns:

RankID = SWITCH(Dates[Month Name], "January", 1, "February", 2, "March", 3, "April", 4, "May", 5, "June", 6, "July", 7, "August", 8, "September", 9, "October", 10, "November", 11, "December", 12)

Running Total = CALCULATE(SUM(Dates[Working Hours]), FILTER(Dates, Dates[RankID] >= EARLIER(Dates[RankID])))

 

Measure:

Percentage = MAX(Dates[Running Total]) / CALCULATE(SUM(Dates[Working Hours]), ALL(Dates))

 

The result will be like below:

Capture.PNG

 

You can refer to the attached pbix.

 

Community Support Team _ Jimmy Tao

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-yuta-msft
Community Support
Community Support

@rosscortb ,

 

I'm confused on your description, could you please clarify more details about your requirement and share some sample data?

 

Regards,

Jimmy Tao

Hi @v-yuta-msft 

 

Example 

 

From the attached, I was looking to get Jan being at 100% then we move into Feb the working hours left in the year would 91.13% and so on....

Does that makes sense?

 

Thanks

 

Ross

 

 

 

@rosscortb ,

 

Create two calculate columns and a measure using dax as below:

 

Calculate Columns:

RankID = SWITCH(Dates[Month Name], "January", 1, "February", 2, "March", 3, "April", 4, "May", 5, "June", 6, "July", 7, "August", 8, "September", 9, "October", 10, "November", 11, "December", 12)

Running Total = CALCULATE(SUM(Dates[Working Hours]), FILTER(Dates, Dates[RankID] >= EARLIER(Dates[RankID])))

 

Measure:

Percentage = MAX(Dates[Running Total]) / CALCULATE(SUM(Dates[Working Hours]), ALL(Dates))

 

The result will be like below:

Capture.PNG

 

You can refer to the attached pbix.

 

Community Support Team _ Jimmy Tao

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

Thanks v much, great help @v-yuta-msft 🙂

Greg_Deckler
Super User
Super User

Tough to say without source data. You could hard code it 🙂

@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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