March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hi,
I am trying to calculate a 'share of trade' metric where the 'Total Market Sales' exists within my table. My example table looks like this:
I want to determine the following:
Shop A's share of Total Market Sales for Category A.
I currently have visual filters on the Category, Market, Time and State (I have another table called 'time type' that categorises FY or QTR).
I have tried the following
Solved! Go to Solution.
Hi, @liam_c
According to your description and sample data, I can roughly understand your requirement, I think you can try this measure:
Share of Trade =
VAR _TotalMarketSales =
CALCULATE (
SUM ( 'Table'[Sales] ),
FILTER (
ALL ( 'Table' ),
[Category] = MAX ( 'Table'[Category] )
&& [Market] = "Total Market"
)
)
RETURN
DIVIDE ( SUM ( 'Table'[Sales] ), _TotalMarketSales )
You can set the measure format to "Percentage" like this:
Then you can create a table chart and place and set the visual like this to get your expected output:
And you can get what you want.
You can download my test pbix file below
If this result is not what you want, you can post some sample data(without sensitive data) and your expected result.
How to Get Your Question Answered Quickly
Thank you very much!
Best Regards,
Community Support Team _Robert Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @liam_c
According to your description and sample data, I can roughly understand your requirement, I think you can try this measure:
Share of Trade =
VAR _TotalMarketSales =
CALCULATE (
SUM ( 'Table'[Sales] ),
FILTER (
ALL ( 'Table' ),
[Category] = MAX ( 'Table'[Category] )
&& [Market] = "Total Market"
)
)
RETURN
DIVIDE ( SUM ( 'Table'[Sales] ), _TotalMarketSales )
You can set the measure format to "Percentage" like this:
Then you can create a table chart and place and set the visual like this to get your expected output:
And you can get what you want.
You can download my test pbix file below
If this result is not what you want, you can post some sample data(without sensitive data) and your expected result.
How to Get Your Question Answered Quickly
Thank you very much!
Best Regards,
Community Support Team _Robert Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@liam_c , Try like
Share of Trade = DIVIDE(SUM(DF[Sales]),CALCULATE(SUM(DF[Sales]),Filter(allselected(DF),DF[STATE] = max(DF[STATE]) && DF[Time] = max(DF[Time]) && DF[Time_Type] = max(DF[Time_Type]) && DF[Market] = "Total Market")),0)
Hi,
This still delivers 0.00% for all values
User | Count |
---|---|
120 | |
78 | |
58 | |
52 | |
46 |
User | Count |
---|---|
170 | |
117 | |
63 | |
58 | |
51 |