Supplies are limited. Contact info@espc.tech right away to save your spot before the conference sells out.
Get your discountScore big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount
I have a Stock table called "S Stock" in which I have the column [tipodeposito] (which is the type of deposit) and [deposit] (which is the deposit per se). I created a Stock measure that only took into account some of the types of deposits and deposits. However, when I make a table in the report and categorize it by type of deposit, it shows the entire stock without differentiation. I have made this two ways (keep in mind [cantidad] in quantity):
1.
2.
In this case, I created two measures in order to better differentiate the stock I want to take into account from [tipodeposito] = "Consignado" and from [tipodeposito] = "Bodega". So:
How can I have a graph in which the total stock is divided into these two categories, but in which "Bodega" only has those three deposits I mentiones ("ALMACEN PYH", "BODEGA PYH", "Casa Big Sur"), and without using filters in the table, just in the formula?
Thanks!
Solved! Go to Solution.
Hi Gökberk,
Thanks for the reply.
Actually, [tipodeposito] is a column.
However, I could finally find a solution thanks to an unending conversation and iteration with ChatGPT lol. I'll post its final answer here:
Solution:
1. Modify the Stock Bodega Measure: Ensure that the filter is correctly applied to sum only the corresponding values.
DAX
Copiar código
Stock Bodega =
SUMX(
FILTER(
'S Stock',
'S Stock'[deposito] IN { "ALMACEN PYH", "BODEGA PYH", "Casa Big Sur" }
),
'S Stock'[cantidad]
)
2. Modify the Stock Consignado Measure: Ensure that only the values for "Consignado" are summed.
DAX
Copiar código
Stock Consignado =
SUMX(
FILTER(
'S Stock',
'S Stock'[tipodeposito] = "Consignado"
),
'S Stock'[cantidad]
)
3. Modify the Stock Measure: Integrate both measures and calculate the total.
DAX
Copiar código
Stock =
CALCULATE(
[Stock Bodega] + [Stock Consignado]
)
Explanation:
SUMX: Iterates over the rows of the table that meet the given conditions and sums the [cantidad] values.
FILTER: Filters the rows of the table based on the criteria set for [deposito] and [tipodeposito].
CALCULATE: Sums the values of [Stock Bodega] and [Stock Consignado] while respecting the established filters.
Hello @jfat,
Category format needs to be column. Measures can't be added into Category. If you want to add it you can use power query transformation or Dax new column.
Kind Regards,
Gökberk Uzuntaş
📌 If this post helps, then please consider Accepting it as a solution and giving Kudos — it helps other members find answers faster!
🔗 Stay Connected:
📘 Medium |
📺 YouTube |
💼 LinkedIn |
📷 Instagram |
🐦 X |
👽 Reddit |
🌐 Website |
🎵 TikTok |
Hi Gökberk,
Thanks for the reply.
Actually, [tipodeposito] is a column.
However, I could finally find a solution thanks to an unending conversation and iteration with ChatGPT lol. I'll post its final answer here:
Solution:
1. Modify the Stock Bodega Measure: Ensure that the filter is correctly applied to sum only the corresponding values.
DAX
Copiar código
Stock Bodega =
SUMX(
FILTER(
'S Stock',
'S Stock'[deposito] IN { "ALMACEN PYH", "BODEGA PYH", "Casa Big Sur" }
),
'S Stock'[cantidad]
)
2. Modify the Stock Consignado Measure: Ensure that only the values for "Consignado" are summed.
DAX
Copiar código
Stock Consignado =
SUMX(
FILTER(
'S Stock',
'S Stock'[tipodeposito] = "Consignado"
),
'S Stock'[cantidad]
)
3. Modify the Stock Measure: Integrate both measures and calculate the total.
DAX
Copiar código
Stock =
CALCULATE(
[Stock Bodega] + [Stock Consignado]
)
Explanation:
SUMX: Iterates over the rows of the table that meet the given conditions and sums the [cantidad] values.
FILTER: Filters the rows of the table based on the criteria set for [deposito] and [tipodeposito].
CALCULATE: Sums the values of [Stock Bodega] and [Stock Consignado] while respecting the established filters.
User | Count |
---|---|
12 | |
11 | |
8 | |
8 | |
6 |
User | Count |
---|---|
25 | |
19 | |
14 | |
10 | |
7 |