Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Dear Team,
I want to show the average of some values and sum of some values based upon the selected slicer option. Say for example, if we have a table A which has columns named products, months, country and sales value. Products column had books and phones. If user selects books the value should be shown as average of Sales Value column keeping months, country constant (same as FIXED function in tableau) and if user selects phones sum of sales value should be shown keeping months, country constant.
Your support is appreciated.
thanks
Solved! Go to Solution.
Hi, @Aishu_2609
Books and phones are the contents of the "Products" field where I group them in the formula.
If the results are incorrect, please share sample data and expected results for further research.
Best Regards,
Community Support Team _ Eason
@v-easonf-msft Manny thanks for this , can you kindly confirm if I can use Msales as a slicer and slicer will show books and phones as 2 options to select?
Hi, @Aishu_2609
Books and phones are the contents of the "Products" field where I group them in the formula.
If the results are incorrect, please share sample data and expected results for further research.
Best Regards,
Community Support Team _ Eason
Many Thanks
Hi, @Aishu_2609
Please try measure like blow:
M_Sales =
SWITCH (
SELECTEDVALUE ( 'Table'[Products] ),
"Books",
CALCULATE (
AVERAGE ( 'Table'[sales] ),
FILTER (
ALL ( 'Table' ),
'Table'[country] = MAX ( 'Table'[country] )
&& 'Table'[Products] = MAX ( 'Table'[Products] )
)
),
"Phones",
CALCULATE (
SUM ( 'Table'[sales] ),
FILTER (
ALL ( 'Table' ),
'Table'[country] = MAX ( 'Table'[country] )
&& 'Table'[Products] = MAX ( 'Table'[Products] )
)
)
)
Best Regards,
Community Support Team _ Eason
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
143 | |
85 | |
66 | |
51 | |
45 |
User | Count |
---|---|
217 | |
89 | |
82 | |
66 | |
57 |