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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Chanleakna123
Post Prodigy
Post Prodigy

Having trouble with %Shared Formula with Measure

hi all , i wanna calculate the %Contribution in each year based on Business Type. in each year total %100

but what i have is Y_2021 which is calculated from Measure below  , and i use the Percentage of Grand Total  in BI , but shown 0% , it is wrong , which formula that i can use to acheive this ?  

but when i use visualize "100% Stack Column Chart " in BI , it generates the result i wanted . But it is Column Chart , I want it to be on Line Chart. 

 

Y_2021 = SWITCH(TRUE(),
'Final Measure'[Final Selection]="UC",[UC],
'Final Measure'[Final Selection]="$NSR",[$NSR],
'Final Measure'[Final Selection]="Total Transaction",[Total Transaction],
'Final Measure'[Final Selection]="$NSR/UC",[$NSR/UC],
'Final Measure'[Final Selection]="Total Industry NSR",[Total Industry NSR],
'Final Measure'[Final Selection]="UC Total Industry",[UC Total Industry],
BLANK())

Capture 3.PNG

1 ACCEPTED SOLUTION

Hi @Chanleakna123 ,

 

You may create measure like DAX below.

 

%Contribution =
DIVIDE (
    CALCULATE (
        [Y_2021],
        FILTER (
            ALLSELECTED ( Table1 ),
            Table1[Year] = MAX ( Table1[Year] )
                && Table1[ Business Type] = MAX ( Table1[ Business Type] )
        )
    ),
    CALCULATE (
        [Y_2021],
        FILTER ( ALLSELECTED ( Table1 ), Table1[Year] = MAX ( Table1[Year] ) )
    )
)

Best Regards,

Amy 

 

Community Support Team _ Amy

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

3 REPLIES 3

hi , actually  i have acheived this , but the thing is when i continue doing another formula for %contribution , it doesn't work out 

Hi @Chanleakna123 ,

 

You may create measure like DAX below.

 

%Contribution =
DIVIDE (
    CALCULATE (
        [Y_2021],
        FILTER (
            ALLSELECTED ( Table1 ),
            Table1[Year] = MAX ( Table1[Year] )
                && Table1[ Business Type] = MAX ( Table1[ Business Type] )
        )
    ),
    CALCULATE (
        [Y_2021],
        FILTER ( ALLSELECTED ( Table1 ), Table1[Year] = MAX ( Table1[Year] ) )
    )
)

Best Regards,

Amy 

 

Community Support Team _ Amy

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

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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