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
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
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.