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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

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

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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