Showing results for 
Search instead for 
Did you mean: 
Frequent Visitor

How to calculate columns based on slicer selection

Hi Community,

I need a help… I newbie in Power BI and have de following case:

I have 2 slicers (Real, Comparative) filtering different calendars dimensions (dCalendar, dCalendarComp). The slicer Real, will be used to calculate a Measure (M1 = SUM(prod)) and the slicer Comparative, will be calculate another measure (M2 = SUM(prod)). Want to highlighted that M1 and M2 are calculated based on differents periods selecteds on slicer. Below it’s the model that I’m using.





In my table fact, I have a column named FLAG. In this column, just have the values 0 or 1. Based on these values, I need calculate a new column (named Index) following the condition: If the value of the FLAG = 1, then the value of the Index = 1, else I need divide M1 per M2 (M1/M2).

The problem is: When the slice is change the column doesn't recalculated to the new period. Can I create a dynamic column based on slicer? If can’t, have a workaround for this?

Super User IV
Super User IV

Re: How to calculate columns based on slicer selection

Columns are not dynamic, they are only calculated at the time of data load/refresh. You need to create a measure.


Putting square pegs in round holes since 1972.

I have a NEW book! 
DAX Cookbook from Packt
Over 120 DAX Recipes!

Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Helpful resources

August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

Community Blog

Community Blog

Visit our Community Blog for articles, guides, and information created by fellow community members.

Community Summit Australia – Join Online!

Community Summit Australia – Join Online!

Be a part of the leading Microsoft Business Applications digital event, curated for the APAC community.