Skip to main content
cancel
Showing results for 
Search instead 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.

Reply
Anonymous
Not applicable

DAX - %contribution for status measure filed to particular years

hi everyone,

 

i have sample super store table. and i calculated "Actual Sales". now i wanted to show "Actual sales" %contribution for each status on particular year.

 

can any one help on this. data provided in this link.

 

Sample-Store-Status.jpg.

 

Thanks in advance

 

regards

venu

1 ACCEPTED SOLUTION

Hi @Anonymous ,

Please try the measure below.

Measure 2 = 
VAR totalforeachyear =
    CALCULATE (
        SUM ( 'Table1'[Actual sales] ),
        ALLEXCEPT ( Table1, 'Table1'[Year] )
    )
VAR salesforeachstatus =
    CALCULATE (
        SUM ( 'Table1'[Actual sales] ),
        ALLEXCEPT ( Table1, Table1[Status_], Table1[Year] )
    )
RETURN
    salesforeachstatus / totalforeachyear

Here is the output.

Capture.PNG

More details, please refer to my attachment.

Best  Regards,

Cherry

 

Community Support Team _ Cherry Gao
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

4 REPLIES 4
Anonymous
Not applicable

 

anybody help on this... my sample output in this link.

Looks like you need

a) a measure to SUM [Actual Sal] taking into account Year and Status.

b) a measure to SUM [Actual Sal] taking into account Year

Then DIVIDE a by b

 

That should give you a start

Anonymous
Not applicable

@HotChilli  Thanks for your response.... that is not working....

Hi @Anonymous ,

Please try the measure below.

Measure 2 = 
VAR totalforeachyear =
    CALCULATE (
        SUM ( 'Table1'[Actual sales] ),
        ALLEXCEPT ( Table1, 'Table1'[Year] )
    )
VAR salesforeachstatus =
    CALCULATE (
        SUM ( 'Table1'[Actual sales] ),
        ALLEXCEPT ( Table1, Table1[Status_], Table1[Year] )
    )
RETURN
    salesforeachstatus / totalforeachyear

Here is the output.

Capture.PNG

More details, please refer to my attachment.

Best  Regards,

Cherry

 

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

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

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors