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
Sander1401
Helper I
Helper I

Percentage of total per week - stacked barchart

Hi all,

 

I have a visual with sales per week in a stacked bar chart, split by brand.
Now I want to make a parameter tot switch between the absolute numbers and % of total per week.
So like below:

weekBrandSales% of total
1A5033%
1B10067%
2A7550%
2B7550%
3A3020%
3B12080%

 

I know I can do this with bookmarks, but I already using some bookmarks, and I want to cover it by using only 1 parameter to switch between these measures.

What should be my formula?

4 REPLIES 4
v-shex-msft
Community Support
Community Support

HI @Sander1401,

You can create a parameter table with category types that use on the slicer as selectors to interact with measure expression to switch different values.

Switching Measures and Titles Dynamically in Power BI - The Data School Australia

Notice: Dax expression does not support returning two or more display formats except you change the measure data type to text.

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Thanks, I think my question was somewhat unclear, my problem was the dax formula of the last column...

Hi @Sander1401,

You can try to use the following measure formula if it is suitable for your requirement:

formula =
DIVIDE (
    CALCULATE (
        SUM ( Table[Sales] ),
        ALLSELECTED ( Table ),
        VALUES ( Table[Week] ),
        VALUES ( Table[Brand] )
    ),
    CALCULATE (
        SUM ( Table[Sales] ),
        ALLSELECTED ( Table ),
        VALUES ( Table[Week] )
    )
)

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help 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.