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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
rconway
New Member

Get a percentage based on a daily goal

I have two simple worksheets in Excel that I am loading into Power BI Desktop.  The first worksheet is an aggregated table aggregated encounters per user per day:

rconway_0-1673985376680.png

The second is a goals sheet that each user needs to meet per day:

rconway_1-1673985448622.png

I have connected the two "tables" in the Desktop based on the User.

 

Trying to get a percentage value if a user had any encounters on a given day.  Example would be if the date filtered was 1/3/2023 I need AMGRAUBNER to show 17 in the AcctCounts column and 34% in a percentage column in a table visual.  All users with encounters for that day would need to be in the table.

 

Second day using PowerBI so any help is greatly appreciated.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

hello @rconway 
you can find the below pbix file: https://1drv.ms/u/s!Ag9tIyk2ofNRjm9wJRUIzsUQ9GsY?e=Hi0tVu

eliasayy_0-1673994516176.png

 

 

eliasayy_1-1673994549201.png


1) create relationship between dimtable and first table by date
2) create relationship between first table users and goal table users

eliasayy_2-1673994870755.png

 



3) create a measure for sum of count column 

 

Sum = calculate(sum(table1[count]))

 


4)create a measure for goal of each user

 

Goal By User = Calculate(max(goaltable[goal]),allexcept(goaltable,goaltable[users]))

 

5) craete a divide measure to get percentage

 

Percentage = DIVIDE([Sum],[Goal By User],0)

 



6) add users to table, and your 3 measures and add date from dimdate to a slicer and there you got it

 

if i helped you solve this problem, a kudos is appreciated and accept this post as solution

View solution in original post

3 REPLIES 3
rconway
New Member

Thank you so much.  The majority of what I am wanting works now.  I have added a Hierarchical Slicer visual and can now choose by Year/Month/Day.  The only thing I would like is to somehow update the Goal_by_User and Percentage column to show correct values above the lowest level (Day).

 

So, if a User had encounters for multiple days in a month, say 5 days, and the daily goal is 50 then the Goal_by_User column would show 250 instead of 50 and the Percentage column would update to the correct Percentage.

Anonymous
Not applicable

I dont know how to do it in dax but if you go to power query, the goals table, you can add 2 columns , 1 is a starting date and the second is today for example

 

The create another new column that lists with the formula

{Number.From([start date])..Number.From([Today])}

 

Them press on the new column header arrow and chose expand to new rows

 

Then change type to date and rename it to date and you can delete start dste column and today column

 

Now just create a relationship between your dste table date and goal table date and whatever you choose the lebgth of dates it will sum up but make sure to change the formula of goals to sum instead of max

Anonymous
Not applicable

hello @rconway 
you can find the below pbix file: https://1drv.ms/u/s!Ag9tIyk2ofNRjm9wJRUIzsUQ9GsY?e=Hi0tVu

eliasayy_0-1673994516176.png

 

 

eliasayy_1-1673994549201.png


1) create relationship between dimtable and first table by date
2) create relationship between first table users and goal table users

eliasayy_2-1673994870755.png

 



3) create a measure for sum of count column 

 

Sum = calculate(sum(table1[count]))

 


4)create a measure for goal of each user

 

Goal By User = Calculate(max(goaltable[goal]),allexcept(goaltable,goaltable[users]))

 

5) craete a divide measure to get percentage

 

Percentage = DIVIDE([Sum],[Goal By User],0)

 



6) add users to table, and your 3 measures and add date from dimdate to a slicer and there you got it

 

if i helped you solve this problem, a kudos is appreciated and accept this post as solution

Helpful resources

Announcements
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 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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