This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreGet Fabric Certified for FREE during AI Skills Fest. This week only. Secure your voucher now.
I have the following formula. It returns the sum of my raw volume columns base on a slicer selection.
I need to add another slicer that has Raw cases and Equivalent Cases. If the user selects Raw cases- I need to multiple the volume by 1 or do nothing. If the user selects EQ, I need to multiple at the row level, each row in my data set by a field i have in my dataset called "192oz Conversion Factor" . Any help would be great. Thanks
Selected Period Volume =
VAR SPVOLUME =
SELECTEDVALUE ( 'Period Select (2)'[Period Selector])
RETURN
SWITCH (
SPVOLUME,
"YTD",SUM('Power BI Output'[YTD Volume]),
"MTD", SUM('Power BI Output'[MTD Volume]),
"2019", Sum('Power BI Output'[2019 Volume]),
"Rolling 13 Weeks", SUM('Power BI Output'[Rolling 13 Week Volume]),
"Pre-Covid W1-W9", SUM('Power BI Output'[Pre Covid First 9 Wks Volume]),
"Prior 4wks", SUM('Power BI Output'[Current 4 Week Volume]),
"Prior 13wks", SUM('Power BI Output'[Current 13 Week Volume]),
"Prior 26wks", SUM('Power BI Output'[Current 26 Week Volume]),
"Prior 52wks", SUM('Power BI Output'[Current 52 Week Volume]))
Solved! Go to Solution.
Hello @Anonymous
Using another switch and SUMX should get you what you are looking for. I don't know what the name of the table is where the user selection for "RAW" or "EQ" sits so you will have to update that.
Selected Period Volume Converted =
VAR SPVOLUME = SELECTEDVALUE ( 'Period Select (2)'[Period Selector] )
VAR CONVERSION = SELECTEDVALUE ( 'Conversion Table'[Conversion Rate] )
RETURN
SWITCH (
CONVERSION,
"RAW",
SWITCH (
SPVOLUME,
"YTD", SUM ( 'Power BI Output'[YTD Volume] ),
"MTD", SUM ( 'Power BI Output'[MTD Volume] ),
"2019", SUM ( 'Power BI Output'[2019 Volume] ),
"Rolling 13 Weeks", SUM ( 'Power BI Output'[Rolling 13 Week Volume] ),
"Pre-Covid W1-W9", SUM ( 'Power BI Output'[Pre Covid First 9 Wks Volume] ),
"Prior 4wks", SUM ( 'Power BI Output'[Current 4 Week Volume] ),
"Prior 13wks", SUM ( 'Power BI Output'[Current 13 Week Volume] ),
"Prior 26wks", SUM ( 'Power BI Output'[Current 26 Week Volume] ),
"Prior 52wks", SUM ( 'Power BI Output'[Current 52 Week Volume] )
),
"EQ",
SWITCH (
SPVOLUME,
"YTD",
SUMX (
'Power BI Output',
'Power BI Output'[YTD Volume] * 'Power BI Output'[192oz Conversion Factor]
),
"MTD",
SUMX (
'Power BI Output',
'Power BI Output'[MTD Volume] * 'Power BI Output'[192oz Conversion Factor]
),
"2019",
SUMX (
'Power BI Output',
'Power BI Output'[2019 Volume] * 'Power BI Output'[192oz Conversion Factor]
),
"Rolling 13 Weeks",
SUMX (
'Power BI Output',
'Power BI Output'[Rolling 13 Week Volume] * 'Power BI Output'[192oz Conversion Factor]
),
"Pre-Covid W1-W9",
SUMX (
'Power BI Output',
'Power BI Output'[Pre Covid First 9 Wks Volume] * 'Power BI Output'[192oz Conversion Factor]
),
"Prior 4wks",
SUMX (
'Power BI Output',
'Power BI Output'[Current 4 Week Volume] * 'Power BI Output'[192oz Conversion Factor]
),
"Prior 13wks",
SUMX (
'Power BI Output',
'Power BI Output'[Current 13 Week Volume] * 'Power BI Output'[192oz Conversion Factor]
),
"Prior 26wks",
SUMX (
'Power BI Output',
'Power BI Output'[Current 26 Week Volume] * 'Power BI Output'[192oz Conversion Factor]
),
"Prior 52wks",
SUMX (
'Power BI Output',
'Power BI Output'[Current 52 Week Volume] * 'Power BI Output'[192oz Conversion Factor]
)
)
)
@Anonymous First, daxformatter.com is your friend! 🙂 Second, if I understand correctly I think the below calculation should work. If not @ me and post sample data and expected output as text. Thanks!
Selected Period Volume =
VAR SPVOLUME =
SELECTEDVALUE ( 'Period Select (2)'[Period Selector] )
RETURN
IF(SPVOLUME = "Raw cases",
SWITCH (
SPVOLUME,
"YTD", SUM ( 'Power BI Output'[YTD Volume] ),
"MTD", SUM ( 'Power BI Output'[MTD Volume] ),
"2019", SUM ( 'Power BI Output'[2019 Volume] ),
"Rolling 13 Weeks", SUM ( 'Power BI Output'[Rolling 13 Week Volume] ),
"Pre-Covid W1-W9", SUM ( 'Power BI Output'[Pre Covid First 9 Wks Volume] ),
"Prior 4wks", SUM ( 'Power BI Output'[Current 4 Week Volume] ),
"Prior 13wks", SUM ( 'Power BI Output'[Current 13 Week Volume] ),
"Prior 26wks", SUM ( 'Power BI Output'[Current 26 Week Volume] ),
"Prior 52wks", SUM ( 'Power BI Output'[Current 52 Week Volume] )
),
SWITCH (
SPVOLUME,
"YTD", SUMX ( 'Power BI Output',[YTD Volume]*[192oz Conversion Factor] ),
"MTD", SUMX ( 'Power BI Output',[MTD Volume]*[192oz Conversion Factor] ),
"2019", SUMX ( 'Power BI Output',[2019 Volume]*[192oz Conversion Factor] ),
"Rolling 13 Weeks", SUMX ( 'Power BI Output',[Rolling 13 Week Volume]*[192oz Conversion Factor] ),
"Pre-Covid W1-W9", SUMX ( 'Power BI Output',[Pre Covid First 9 Wks Volume]*[192oz Conversion Factor] ),
"Prior 4wks", SUMX ( 'Power BI Output',[Current 4 Week Volume]*[192oz Conversion Factor] ),
"Prior 13wks", SUMX ( 'Power BI Output',[Current 13 Week Volume]*[192oz Conversion Factor] ),
"Prior 26wks", SUMX ( 'Power BI Output',[Current 26 Week Volume]*[192oz Conversion Factor] ),
"Prior 52wks", SUMX ( 'Power BI Output',[Current 52 Week Volume]*[192oz Conversion Factor] )
)
)
Hello @Anonymous
Using another switch and SUMX should get you what you are looking for. I don't know what the name of the table is where the user selection for "RAW" or "EQ" sits so you will have to update that.
Selected Period Volume Converted =
VAR SPVOLUME = SELECTEDVALUE ( 'Period Select (2)'[Period Selector] )
VAR CONVERSION = SELECTEDVALUE ( 'Conversion Table'[Conversion Rate] )
RETURN
SWITCH (
CONVERSION,
"RAW",
SWITCH (
SPVOLUME,
"YTD", SUM ( 'Power BI Output'[YTD Volume] ),
"MTD", SUM ( 'Power BI Output'[MTD Volume] ),
"2019", SUM ( 'Power BI Output'[2019 Volume] ),
"Rolling 13 Weeks", SUM ( 'Power BI Output'[Rolling 13 Week Volume] ),
"Pre-Covid W1-W9", SUM ( 'Power BI Output'[Pre Covid First 9 Wks Volume] ),
"Prior 4wks", SUM ( 'Power BI Output'[Current 4 Week Volume] ),
"Prior 13wks", SUM ( 'Power BI Output'[Current 13 Week Volume] ),
"Prior 26wks", SUM ( 'Power BI Output'[Current 26 Week Volume] ),
"Prior 52wks", SUM ( 'Power BI Output'[Current 52 Week Volume] )
),
"EQ",
SWITCH (
SPVOLUME,
"YTD",
SUMX (
'Power BI Output',
'Power BI Output'[YTD Volume] * 'Power BI Output'[192oz Conversion Factor]
),
"MTD",
SUMX (
'Power BI Output',
'Power BI Output'[MTD Volume] * 'Power BI Output'[192oz Conversion Factor]
),
"2019",
SUMX (
'Power BI Output',
'Power BI Output'[2019 Volume] * 'Power BI Output'[192oz Conversion Factor]
),
"Rolling 13 Weeks",
SUMX (
'Power BI Output',
'Power BI Output'[Rolling 13 Week Volume] * 'Power BI Output'[192oz Conversion Factor]
),
"Pre-Covid W1-W9",
SUMX (
'Power BI Output',
'Power BI Output'[Pre Covid First 9 Wks Volume] * 'Power BI Output'[192oz Conversion Factor]
),
"Prior 4wks",
SUMX (
'Power BI Output',
'Power BI Output'[Current 4 Week Volume] * 'Power BI Output'[192oz Conversion Factor]
),
"Prior 13wks",
SUMX (
'Power BI Output',
'Power BI Output'[Current 13 Week Volume] * 'Power BI Output'[192oz Conversion Factor]
),
"Prior 26wks",
SUMX (
'Power BI Output',
'Power BI Output'[Current 26 Week Volume] * 'Power BI Output'[192oz Conversion Factor]
),
"Prior 52wks",
SUMX (
'Power BI Output',
'Power BI Output'[Current 52 Week Volume] * 'Power BI Output'[192oz Conversion Factor]
)
)
)
@jdbuchanan71 Apparently that message took me 4 minutes to write!! 😄
Check out the May 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 25 | |
| 24 | |
| 22 | |
| 19 | |
| 18 |
| User | Count |
|---|---|
| 43 | |
| 42 | |
| 41 | |
| 21 | |
| 21 |