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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
SpiroswayGR
Resolver III
Resolver III

Percentage on Subcategory

Hello everyone,

 

I want to create a subcategory percentage but something goes wrong.

SpiroswayGR_0-1658149050005.png

I found some related solutions but it looks like they are not working because I have measured instead of the calculated column.

 

I wrote a dax like this 

Ar_per% = IF (
ISINSCOPE (table1[Agent]),
IF (
ISINSCOPE (Calendar_System[DateBand] ),
MAX (table1[measure2])
/ CALCULATE (
SUMX(table1,table1[measure2]),
FILTER ( ALL ( table1), table1[Agent] = MAX ( table1[Agent] ) )
),
CALCULATE (
SUMX(table1,table1[measure2]),
ALLEXCEPT(table1, table1[Agent])/ SUMX(table1,table1[measure2] ), ALL(table1), 1)))

 

any idea? 

 

Thanks in advance!

1 ACCEPTED SOLUTION
SpiroswayGR
Resolver III
Resolver III

@v-kkf-msft thank you! thumb up for your solution!

 

My solution at the end

Ar_SubCat_% =
VAR NumA = IF( ISBLANK( table1[measure2]), BLANK(), CALCULATE(table1[measure2], ALLSELECTED(Calendar_System[DateBand]) ) )
VAR NumB = table1[measure2]
   
VAR div22 = DIVIDE(NumB, NumA, 0 )
Return div22

View solution in original post

4 REPLIES 4
SpiroswayGR
Resolver III
Resolver III

@v-kkf-msft thank you! thumb up for your solution!

 

My solution at the end

Ar_SubCat_% =
VAR NumA = IF( ISBLANK( table1[measure2]), BLANK(), CALCULATE(table1[measure2], ALLSELECTED(Calendar_System[DateBand]) ) )
VAR NumB = table1[measure2]
   
VAR div22 = DIVIDE(NumB, NumA, 0 )
Return div22
v-kkf-msft
Community Support
Community Support

Hi @SpiroswayGR ,

 

Please create these measures.

 

Measure 2 = SUM ( Calendar_System[Value] )
%per category = 
DIVIDE (
    [Measure 2],
    CALCULATE ( [Measure 2], VALUES ( Table1[Agent] ), ALL () )
)

vkkfmsft_0-1658371458250.png

 

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

SpiroswayGR
Resolver III
Resolver III

thumb up for solution 😄 

SpiroswayGR
Resolver III
Resolver III

any correction for this dax? maybe change sumx to sum ? 

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors