Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
i have a table containing pivoted columns. i want a measure to display in a table visual all the pivoted columns's sum. for example, i could have a column called transport, i display the sum of that column, and so on.. the pivoted column is called charge, so i created a distinct table to get the distinct values of that column charge, so when the data is updated and a new value is added to the column, it shows in the distinct table, and it shows as well in the pivoted table. so i want a measure to check where the columns names in my table are equal to the values in my distinct table, and do the sum for those columns to display them dynamically without needing to add them each time to my field parameter or visual
Hi,@Hussein_charif .I am glad to help you.
By pivot columns, do you mean change from rows to columns?
Pivot columns feature description - Power Query | Microsoft Learn
like this?
this is my test data.
Assuming that your original data before transposition looked like this (no columns were transposed, so you could just create a measure to count each column)
Or create a measure via the Distinct table you mentioned.
DynamicSum =
VAR _chargeTypes = MAX('DistinctChargeTypes'[ChargeType])
VAR _chargetable = VALUES(DistinctChargeTypes[ChargeType])
VAR _total = SUMX(
ALL(SalesData),
[Amount]
)
VAR _values = SUMX(
_chargetable,
CALCULATE(
SUM(SalesData[Amount]),
SalesData[ChargeType] = _chargeTypes
)
)
RETURN
IF(
ISINSCOPE('DistinctChargeTypes'[ChargeType]),
_values,
_total
)
If my understanding is wrong, please let me know and provide me with the corresponding pbix file detailing what you did and a screenshot of the expected result.(Share to forum via github link)
I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.
Best Regards,
Carson Jian,
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
hi @v-jtian-msft , thank you for the reply. so lets consider your data, my Columns are the "ChargeType" column's values, after i pivoted the column on my "Amount" column, so now each ChargeType value is a column that has the corresponding Amount. what i want is a measure, or maybe if it is done by a field parameter, so that if different ChargeTypes are added, to be automatically added in my table visual
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
118 | |
75 | |
49 | |
36 | |
35 |
User | Count |
---|---|
195 | |
80 | |
70 | |
56 | |
42 |