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
motyotyotyo
Frequent Visitor

Calculated Column filter dynamic

Hi
I have created a new column with dax this way :

MCS =
VAR CurrentKey = 'Release planner'[FC ID]
VAR MultifactorFiltered = FILTER('Multifactor PI Calculator', 'Multifactor PI Calculator'[Multifactor PI] = "2023PI3")
VAR MatchingKey = COUNTROWS(FILTER(MultifactorFiltered, 'Multifactor PI Calculator'[FC number] = CurrentKey))

VAR DividerToUse =
IF(
MatchingKey > 0,
MAXX(MultifactorFiltered, [Value]),
'Release planner'[FC size]
)

RETURN
IF(
DividerToUse < 1,
'Release planner'[MCS Effort] * DividerToUse,
'Release planner'[MCS Effort] / DividerToUse
)


There reason behind this is that sometimes the column need to be calculated from a different table. I am using this column on different tabs as well and it needs to be able to change by everytab. In the line 3 "2023PI3" part needs to be dynamic in someways, slicer filter not sure.
I have tried to create a new table with just these values and use it as a slicer but it would change the end value.
Thanks inadvance

1 ACCEPTED SOLUTION
v-tangjie-msft
Community Support
Community Support

Hi @motyotyotyo ,

 

If you wish to replace "2023PI3" with the value selected by the slicer, you need to
1. Create a measure instead of a calculated column, because calculated columns cannot change dynamically.
2. Create a slicer table.

3.Change "2023PI3" in the metric to SELECTEDVALUE('Slicer Table'[Value]), which will change depending on the value of the slicer.

vtangjiemsft_0-1692685304430.png

Best Regards,

Neeko Tang

If this post  helps, then please consider Accept it as the solution  to help the other members find it more quickly. 

 

View solution in original post

4 REPLIES 4
v-tangjie-msft
Community Support
Community Support

Hi @motyotyotyo ,

 

If you wish to replace "2023PI3" with the value selected by the slicer, you need to
1. Create a measure instead of a calculated column, because calculated columns cannot change dynamically.
2. Create a slicer table.

3.Change "2023PI3" in the metric to SELECTEDVALUE('Slicer Table'[Value]), which will change depending on the value of the slicer.

vtangjiemsft_0-1692685304430.png

Best Regards,

Neeko Tang

If this post  helps, then please consider Accept it as the solution  to help the other members find it more quickly. 

 

Thanks for the help, it worked , do you mind helping me with this part as well? I want to create a running total of this measure, for which I have an index column for the order. This was the older version:

MCS RT = 
VAR currentIndex = MAX('Release planner'[Index])
RETURN
    CALCULATE(
        SUM('Release planner'[MCS]),
        FILTER(
            ALLSELECTED('Release planner'),
            'Release planner'[Index] <= currentIndex
        )
    )


Many thanks already

Hi @motyotyotyo ,

 

According to your description, here are my steps you can follow as a solution.

(1) This is my test data. 

vtangjiemsft_0-1692693489706.png

(2) We can create a measure. 

total = SUMX(ALL('Release planner'[Index]),[MCS RT])

(3) Then the result is as follows.

vtangjiemsft_1-1692693536138.png

vtangjiemsft_2-1692693548094.png

 

Best Regards,

Neeko Tang

Yes this is what I want to achive, but as in the first space we created a measure for MCS so we can't use the SUM function in line 5 fro MCS RT.

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.