Forum Discussion
Share % Measure Logic tweak help
- 4 months ago
hi GanesaMoorthyGM
Can you try either of the below DAX.Share % =
VAR CurrentCellSales = [All Country MTD Sales MC Band Exclusion]
VAR RowTotalSales =
CALCULATE(
[All Country MTD Sales MC Band Exclusion],
-- Replace 'fact_sales' with your actual dimension table name if this column doesn't live in the fact table
REMOVEFILTERS( fact_sales[MakingCharge_Percent_Band] )
)
RETURN
DIVIDE( CurrentCellSales, RowTotalSales, 0 )Share % = VAR CurrentSales = [All Country MTD Sales MC Band Exclusion] VAR RowTotalSales = CALCULATE ( [All Country MTD Sales MC Band Exclusion], // This removes the filter from the Matrix columns to get the Row Total ALLSELECTED ( 'YourTable'[MakingCharge_Percent_Band] ) ) RETURN DIVIDE ( CurrentSales, RowTotalSales, 0 )Use ALLSELECTED instead of REMOVEFILTER, If you ever apply a slicer to the page that limits the MakingCharge_Percent_Band to only a few specific bands and you want the row total to only reflect the selected bands rather than the entire database.
if this solves your problem, please mark this as solution and give a kudos.
@me so that I don't lose this thread.
I should not share the data btw. I'll share my current measures and how i did this.
In Matrix Visual,
Rows:Btq_Sale_age_Band
Columns:MakingCharge_Percent_Band
Values: Qty, Sales
Measure:
For this i need share % as i mentioned earlier
so for example here mc band <10% the btq age bad 0-30 days sale is 0.09 and the total sale in btq age band is 2.16 so 0.09/2.16 = 4%
this is the logic.
so i need your help in fixing this.