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.
Hello,
I want to calculate a dynamic measure that shows an idividual's sales as a % of her Store's Sales and a separate measure that shows her Sales as a % of her Region's sales.
Total Sales=Sum('FACT Sales'[Amount])
Everytime i try to use ALL or AllExcept on the Store # or Region, i get 100% instead of the desired %.
Thanks!
Thanks!
Solved! Go to Solution.
Hi, @JimSales81
You can try the following methods.
Measure:
Store Sales =
VAR _N1 =
CALCULATE ([Total Sales],
FILTER ( ALL ( 'FACT Sales' ),
RELATED ( 'DIM Sales Person'[Store] ) = MAX ( 'DIM Store'[Store#] ) ) )
RETURN
IF ( NOT ( ISBLANK ( [Total Sales] ) ), _N1 )
Region Sales =
VAR _N1 =
CALCULATE ([Total Sales],
FILTER ( ALL ( 'FACT Sales' ),
RELATED ( 'DIM Store'[Region] ) = MAX ( 'DIM Store'[Region] ) ) )
RETURN
IF ( NOT ( ISBLANK ( [Total Sales] ) ), _N1 )
% of Store Sales = DIVIDE([Total Sales],[Store Sales])
% of Region Sales = DIVIDE([Total Sales],[Region Sales])
Is this the result you expect?
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @JimSales81
You can try the following methods.
Measure:
Store Sales =
VAR _N1 =
CALCULATE ([Total Sales],
FILTER ( ALL ( 'FACT Sales' ),
RELATED ( 'DIM Sales Person'[Store] ) = MAX ( 'DIM Store'[Store#] ) ) )
RETURN
IF ( NOT ( ISBLANK ( [Total Sales] ) ), _N1 )
Region Sales =
VAR _N1 =
CALCULATE ([Total Sales],
FILTER ( ALL ( 'FACT Sales' ),
RELATED ( 'DIM Store'[Region] ) = MAX ( 'DIM Store'[Region] ) ) )
RETURN
IF ( NOT ( ISBLANK ( [Total Sales] ) ), _N1 )
% of Store Sales = DIVIDE([Total Sales],[Store Sales])
% of Region Sales = DIVIDE([Total Sales],[Region Sales])
Is this the result you expect?
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@JimSales81 , try like
% Sales=divide(Sum('FACT Sales'[Amount]), calculate(Sum('FACT Sales'[Amount]), allexcept(Sales, 'Dim Region'[Region]) ) )
% Sales=divide(Sum('FACT Sales'[Amount]), calculate(Sum('FACT Sales'[Amount]), allexcept(Sales, 'Dim Region'[Region]) ) )
% Sales=divide(Sum('FACT Sales'[Amount]), calculate(Sum('FACT Sales'[Amount]), allexcept(Sales, 'Dim Store'[Store]) ) )
Amit,
Thank you but both are still coming up with 100% for everyone. how does the filter context know which region/store to tie to any individual in your measures?
THanks,
Jim
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
114 | |
99 | |
82 | |
70 | |
61 |
User | Count |
---|---|
149 | |
114 | |
107 | |
89 | |
67 |