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 need help on the formula on how can I display the correct values per category.
Scenario: I have an existing table chart in PowerBI and the picture below displays some of the columns (except Product Volume) in the table chart. I want to create "Product Volume" measure = sum of "Product SKU Volume" per "Product". It will display the Product Volume data on the min Product SKU only, the others will be blank/null so it will not display as repetitive values. The desired output is shown on the pic below.
Hoping someone can help me on this because I've been working on this specific formula for a week already and could not make it to work.
Solved! Go to Solution.
Hi,
I am not sure how your semantic model looks like, but I tried to create a sample pbix file like below.
Please check the below picture and the attached pbix file.
Product SKU volume measure: =
SUM( fact_volume[Product SKU Volumn] )
INDEX function (DAX) - DAX | Microsoft Learn
expected result measure: =
VAR _result =
CALCULATE (
[Product SKU volume measure:],
ALLEXCEPT ( dim_product, dim_product[Product] )
)
VAR _condition =
MAX ( dim_product[Product SKU] )
= MAXX (
INDEX (
1,
ALL ( dim_product ),
ORDERBY ( dim_product[Product SKU], ASC ),
,
PARTITIONBY ( dim_product[Product] )
),
dim_product[Product SKU]
)
RETURN
_result * DIVIDE ( _condition, _condition )
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
Hi,
I am not sure how your semantic model looks like, but I tried to create a sample pbix file like below.
Please check the below picture and the attached pbix file.
Product SKU volume measure: =
SUM( fact_volume[Product SKU Volumn] )
INDEX function (DAX) - DAX | Microsoft Learn
expected result measure: =
VAR _result =
CALCULATE (
[Product SKU volume measure:],
ALLEXCEPT ( dim_product, dim_product[Product] )
)
VAR _condition =
MAX ( dim_product[Product SKU] )
= MAXX (
INDEX (
1,
ALL ( dim_product ),
ORDERBY ( dim_product[Product SKU], ASC ),
,
PARTITIONBY ( dim_product[Product] )
),
dim_product[Product SKU]
)
RETURN
_result * DIVIDE ( _condition, _condition )
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
Hi @summer18 ,
Can you please post your data as a workable table, not an image? You may post a link to an Excel file online.
Proud to be a Super User!
Please try either:
Calc Column =
VAR __MIN_SKU =
CALCULATE ( MIN ( data[SKU] ), ALLEXCEPT ( data, data[Product] ) )
VAR __TOTAL_BY_PRODUCT =
CALCULATE ( SUM ( data[Volume] ), ALLEXCEPT ( data, data[Product] ) )
RETURNjUST
IF ( data[SKU] = __MIN_SKU, __TOTAL_BY_PRODUCT )
Measure =
VAR __MIN_SKU =
CALCULATE ( MIN ( data[SKU] ), ALLEXCEPT ( data, data[Product] ) )
VAR __TOTAL_BY_PRODUCT =
CALCULATE ( SUM ( data[Volume] ), ALLEXCEPT ( data, data[Product] ) )
RETURN
IF ( SELECTEDVALUE ( data[SKU] ) = __MIN_SKU, __TOTAL_BY_PRODUCT
Proud to be a Super User!
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 |
---|---|
124 | |
89 | |
84 | |
70 | |
51 |
User | Count |
---|---|
206 | |
143 | |
97 | |
79 | |
68 |