Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
aucklanduser
Helper I
Helper I

Dynamic custom column workaround

Hi all,

 

I realise that custom columns are only generated at data refresh so can't be used with slicer selectvalues however I am at a loss as to how to incorporate the slicer selection into my model at a ROW by ROW basis. A measure for my modelling (that I have tried) will not work as it aggregates the total and applies it rather than to each line.

 

I am trying to do a what if scenario analysis on commission rates on invoices. Our model is trying to show that if a level of gross margin is achieved, commission is generated at the slicer value above that (eg SelectedMargin%Value - InvoiceMargin% = Commissionable%). I currently have all the calculations working as expected via measures, this however doesnt net me the result that I want as the total gets aggregated and when I show this at a total level (by branch).

 

Any ideas would be much appreciated! Cheers

1 ACCEPTED SOLUTION

Thanks for the reply Yuliana, this doesnt work unfortunately with my data as I need to run a calculation at row level then aggregate into categories.

 

I have found a solution by making a measure with a combintion of SUMX and ADDCOLUMNS. This runs the calculation by row level and can still be aggregated by category and run the sum correctly (rather than just running the calculation on the category totals).

 

View solution in original post

4 REPLIES 4
v-yulgu-msft
Microsoft Employee
Microsoft Employee

Hi @aucklanduser,

 

I would suggest you firstly have a look at Measure and Row Context.

Row context and Filter context in DAX

Power BI/PowerPivot: What is Row Context?

 

In your scenario, to make measures to display results at a row by row basis rather than an aggregated value, you shuold add an extra field (any type is available) which is not aggregated into the visual. Please see the difference in below screenshot.

1.PNG

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks for the reply Yuliana, this doesnt work unfortunately with my data as I need to run a calculation at row level then aggregate into categories.

 

I have found a solution by making a measure with a combintion of SUMX and ADDCOLUMNS. This runs the calculation by row level and can still be aggregated by category and run the sum correctly (rather than just running the calculation on the category totals).

 

edhans
Community Champion
Community Champion

You can use a Calculated Column as a slicer. It is one of the few times using a calculated column makes sense, assuming you cannot get the same result in the source table (via Power Query, or at the true data source).

 

You cannot use a measure as a slicer though.



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

Hey edhans,

 

Sorry, not meaning use it as a slicer but have the slicer value drive the measure/calculated column. 

Below is an example of my working measures that I cant replicate as columns

 

image.png

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.