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

% of total

Hi all,

 

i have a file which contain 2018 Jan - Dec and 2019 Jan - Aug sales data.  i add a bar chart by product catalog and seperate 2019 and 2018 by 2 bar, then create 2 slicers (year and month).  then i add %GT Line Value on the tooltips,

when i mouse over 2019 bar, it show the % of the total line value (2018+2019). 

but i want the result is the % of total line value of each year .  thanks in advance.  

 

Joey2019-08-12_22h00_29.jpg

2 ACCEPTED SOLUTIONS
Mariusz
Community Champion
Community Champion

Hi @joeytsui 

 

You can use ALL() or ALLSELECTED() in your Measure

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
Mariusz Repczynski

 

View solution in original post

dax
Community Support
Community Support

Hi joeytsui,

Below is my design:

My sample data 

year    category      amount       month

2018 Drink 100 1
2018 Oil 200 1
2018 Ice cream 100 1
2019 Drink 400 1
2019 Oil 200 1
2019 Ice cream 200 1
2018 Drink 100 2
2018 Oil 300 2
2018 Ice cream 500 2
2019 Drink 200 2
2019 Oil 100 2
2019 Ice cream 300 2
2018 Drink 100 3
2018 Oil 200 3
2018 Ice cream 100 3
2019 Drink 200 3
2019 Oil 600 3
2019 Ice cream 200 3
2018 Drink 300 4
2018 Oil 100 4
2018 Ice cream 200 4
2019 Drink 100 4
2019 Oil 600 4
2019 Ice cream 500 4

 Then I create a measure like below

% line =
SUM ( chart[amount] )
    / CALCULATE (
        SUM ( chart[amount] ),
        FILTER ( ALLSELECTED ( chart ), chart[year] = MIN ( chart[year] ) )
    )

Then use year and month in slicer, you will get the result like below

219.PNG

Best Regards,
Zoe Zhi

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
dax
Community Support
Community Support

Hi joeytsui,

Below is my design:

My sample data 

year    category      amount       month

2018 Drink 100 1
2018 Oil 200 1
2018 Ice cream 100 1
2019 Drink 400 1
2019 Oil 200 1
2019 Ice cream 200 1
2018 Drink 100 2
2018 Oil 300 2
2018 Ice cream 500 2
2019 Drink 200 2
2019 Oil 100 2
2019 Ice cream 300 2
2018 Drink 100 3
2018 Oil 200 3
2018 Ice cream 100 3
2019 Drink 200 3
2019 Oil 600 3
2019 Ice cream 200 3
2018 Drink 300 4
2018 Oil 100 4
2018 Ice cream 200 4
2019 Drink 100 4
2019 Oil 600 4
2019 Ice cream 500 4

 Then I create a measure like below

% line =
SUM ( chart[amount] )
    / CALCULATE (
        SUM ( chart[amount] ),
        FILTER ( ALLSELECTED ( chart ), chart[year] = MIN ( chart[year] ) )
    )

Then use year and month in slicer, you will get the result like below

219.PNG

Best Regards,
Zoe Zhi

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

Mariusz
Community Champion
Community Champion

Hi @joeytsui 

 

You can use ALL() or ALLSELECTED() in your Measure

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
Mariusz Repczynski

 

sorry for late reply, thank you so much !

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.