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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply

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.

 

image.png

 

 

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?

1 REPLY 1
Greg_Deckler
Super User
Super User

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


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors