Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi. I am trying to show sales for different countries for a particular year and period. However the measure I created to sum isn't showing the correct total at the grand total line.
Sales = switch(true(), country = "USA", calculate(sum(sales table[sales_amount]), channel = "Store"), calculate(sum(sales table[sales_amount]), channel <> "Store"))
Solved! Go to Solution.
Hi, @Sagejah9
Please try formula as below:
Sales =
VAR a =
SUM ( 'sales table'[sales_amount] )
VAR b =
SUM ( 'sales table'[sales_amount] )
RETURN
SWITCH (
TRUE (),
SUM ( 'sales table'[country] ) = "USA", a,
channel = "Store", b,
channel <> "Store"
)
If it doesn't work, please share some relevant screenshots for further research.
Best Regards,
Community Support Team _ Eason
Hi, @Sagejah9
Please try formula as below:
Sales =
VAR a =
SUM ( 'sales table'[sales_amount] )
VAR b =
SUM ( 'sales table'[sales_amount] )
RETURN
SWITCH (
TRUE (),
SUM ( 'sales table'[country] ) = "USA", a,
channel = "Store", b,
channel <> "Store"
)
If it doesn't work, please share some relevant screenshots for further research.
Best Regards,
Community Support Team _ Eason
@Sagejah9 , try like
Sales = calculate(sum(sales table[sales_amount]), channel = "Store", country = "USA") + calculate(sum(sales table[sales_amount]), channel <> "Store", country <> "USA")
Use the filter in calculate, if needed
http://dataap.org/blog/2019/04/22/difference-between-calculate-with-and-without-filter-expression/
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 40 | |
| 38 | |
| 36 | |
| 29 | |
| 28 |
| User | Count |
|---|---|
| 126 | |
| 88 | |
| 78 | |
| 66 | |
| 65 |