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.
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
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 |
---|---|
106 | |
97 | |
80 | |
67 | |
63 |
User | Count |
---|---|
147 | |
110 | |
108 | |
85 | |
64 |