March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
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.
Best Regards,
Gökberk Uzuntaş
LinkedIn: https://www.linkedin.com/in/g%C3%B6kberk-uzunta%C5%9F-b43906198/
Medium: https://medium.com/@uzuntasgokberk
İf this post helps, then please consider Accept it as solution and kudos to help the other members find it more quickly.
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.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
23 | |
15 | |
12 | |
9 | |
8 |
User | Count |
---|---|
41 | |
32 | |
29 | |
12 | |
12 |