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
liberty345
Regular Visitor

Percentage Calculation

Hi Experts,

I am trying to create a measure to get % column as below table, where each subcategory is getting divided by total of main category.

 

liberty345_0-1705379944547.png

 

Thanks in advance!

2 ACCEPTED SOLUTIONS
v-tangjie-msft
Community Support
Community Support

Hi @liberty345 ,

 

According to your description, here are my steps you can follow as a solution.

(1) This is my test data.  

vtangjiemsft_0-1705478845046.png

vtangjiemsft_4-1705479290520.png

 

 

Measure = COUNT('Table'[Type2])
Measure 2 = SUM('Table (2)'[Value])

 

(2) We can create measures. 

 

Total Measure = CALCULATE([Measure],ALL('Table'))
% Measure = DIVIDE([Measure],[Total Measure],0)
% = DIVIDE(SUM('Table (2)'[Value]),CALCULATE(SUM('Table (2)'[Value]),FILTER(ALLSELECTED('Table (2)'),'Table (2)'[Type]="Main category")),0)

 

(3) Then the result is as follows.

vtangjiemsft_3-1705479273222.png

 

 

If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.

 

Best Regards,

Neeko Tang

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

3CloudThomas
Super User
Super User

The [measure] would be something like [Net Sales]. Here are all the measures:

NetSales = SUM(Sales[SalesAmount])

TermPlanPct = DIVIDE([Net Sales], [TermPlanTotal])

TermPlanTotal =
CALCULATE(
    [Net Sales],
    All(Sales)
)

TermTotalPct.png

View solution in original post

6 REPLIES 6
3CloudThomas
Super User
Super User

The [measure] would be something like [Net Sales]. Here are all the measures:

NetSales = SUM(Sales[SalesAmount])

TermPlanPct = DIVIDE([Net Sales], [TermPlanTotal])

TermPlanTotal =
CALCULATE(
    [Net Sales],
    All(Sales)
)

TermTotalPct.png

Thank you for your valuable support - @3CloudThomas 🙂

 

v-tangjie-msft
Community Support
Community Support

Hi @liberty345 ,

 

According to your description, here are my steps you can follow as a solution.

(1) This is my test data.  

vtangjiemsft_0-1705478845046.png

vtangjiemsft_4-1705479290520.png

 

 

Measure = COUNT('Table'[Type2])
Measure 2 = SUM('Table (2)'[Value])

 

(2) We can create measures. 

 

Total Measure = CALCULATE([Measure],ALL('Table'))
% Measure = DIVIDE([Measure],[Total Measure],0)
% = DIVIDE(SUM('Table (2)'[Value]),CALCULATE(SUM('Table (2)'[Value]),FILTER(ALLSELECTED('Table (2)'),'Table (2)'[Type]="Main category")),0)

 

(3) Then the result is as follows.

vtangjiemsft_3-1705479273222.png

 

 

If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.

 

Best Regards,

Neeko Tang

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

Thank you so much @v-tangjie-msft for the solution! 🙂

3CloudThomas
Super User
Super User

First, create a total measure
TermPlanTotal = CALCULATE ( [measurename], ALL( <tablename>) )
TermPlanPct = DIVIDE( [measurename], TermPlanTotal)
Format TermPlanPct as a Percent

Thank you, @3CloudThomas!

I attempted to create a measure using the provided solution, but all values are consistently showing as 100%. I'm unsure of what might be causing this issue.

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.