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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
Anonymous
Not applicable

Struggling to create a "% of Distinct Count of StudentID" measure in DAX

I am tasked with emulating a Tableau dashboard. I have successfully created the visuals that look the Tableau one, but the Tableau has a Mark/custom column called '% of Distinct Count of StudentID', which details the percent of Student divided by the total number of Students for that year. For example, the visual details '300' students, in "Points Earned" bracket '34', during Year '2018'. "Year" is along the X-axis, with "Distinct Count of StudentID" (counting the number of students) on the Y-axis, and "Points Earned" as a Legend.

 

I need to create a DAX measure that calculates the % of students from a 'Year' and a 'Points Earned' bracket against the total number of students from that Year. For example, '300' students, in "Points Earned" bracket '34', during Year '2018' divided by '4000' total students from '2018', should give 7.5%.

 

My current DAX is: 

Percentage_UCAS_CC =
DIVIDE(
    [StudentIDs],
    CALCULATE(
        [StudentIDs], --A measure
        'DataSource',
        'DataSource'[Year],
        'DataSource'[Points Earned],
) * 100
 

TL:DR - Need help making a DAX measure that calculates: Number of Student ID / Total Number of Students for each Year (Percentage format)

 

Any help would be greatly appreciated.

 

 

1 ACCEPTED SOLUTION
Fowmy
Super User
Super User

@Anonymous 

Bsed on the limited details, I modifed your measure assuming you are using the Year and this measure on a visual like a table visual. 

Percentage_UCAS_CC =
DIVIDE (
    [StudentIDs],
    CALCULATE ( [StudentIDs], ALLSELECTED ( 'DataSource'[Points Earned] ) )
)
Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

View solution in original post

3 REPLIES 3
Fowmy
Super User
Super User

@Anonymous 

Bsed on the limited details, I modifed your measure assuming you are using the Year and this measure on a visual like a table visual. 

Percentage_UCAS_CC =
DIVIDE (
    [StudentIDs],
    CALCULATE ( [StudentIDs], ALLSELECTED ( 'DataSource'[Points Earned] ) )
)
Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Anonymous
Not applicable

This worked perfectly, thank you!

Ritaf1983
Super User
Super User

Hi @Anonymous 

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-...
Please show the expected outcome based on the sample data you provided.

https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.