cancel
Showing results for
Did you mean:

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Resolver III

## Percentage on Subcategory

Hello everyone,

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

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?

1 ACCEPTED SOLUTION
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
4 REPLIES 4
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
Community Support

Hi @SpiroswayGR ,

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

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.

Resolver III

thumb up for solution 😄

Resolver III

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

Announcements

#### Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

#### Power BI Monthly Update - April 2024

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

#### Fabric Community Update - April 2024

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

Top Solution Authors
Top Kudoed Authors