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
Oded-Dror
Helper III
Helper III

Dynamic value in calculated column

Hi there,

Please take a look at this picture (AdventureWorksDW)
And tell me if this is possible to store value in calculated column based on dynamic value from a measure.

I've try (see my code) but I got wrong results. - Every time I click on Country I would like to see the revenue change in the calculated column.

Thanks,

Oded DrorCalculated Dynamic Column .png

1 ACCEPTED SOLUTION
jeroendekk
Resolver IV
Resolver IV

Hi @Oded-Dror 
Calculated columns and tables are calculated on refresh and after that they are static.

 

So a slicers will impact which rows of a table are used but not the content itself. A measure could create this result, but you cannot use measure results in a slicer.

So sorry I do not think this is possible.

Best regards,

Jeroen Dekker

View solution in original post

6 REPLIES 6
v-yanjiang-msft
Community Support
Community Support

Hi @Oded-Dror ,

According to your description, you want the calculated column slicer changed according to the country slicer, it cannot be achieved, as tables and calculated columns are established prior to the query and don't change - only get filtered. So the calculated column can be calculated the right value in the data view, then it will be filtered by the country slicer.

In your snapshot, the sub category value depends on the measure revenue, I guess the measure has a SUM function, so the value will always be the sum value. You can modify your measure, or post the formula of the measure if needed, as your sample link cannot be connected.

Best Regards,
Community Support Team _ kalyj

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

Thank you

Oded-Dror
Helper III
Helper III

Is AdventureWorksDW database wich I added Calculated column to the product table

Sub Category Value = 'Product'[Subcategory] & " (" &
Format( CALCULATE([Revenue],
Filter('Product','Product'[ProductKey] = EARLIER('Product'[ProductKey])),
KEEPFILTERS(Customer)
), "#,##") & ")"
 
When I put it in a slicer it show total per subcategory not respecting the Customer Country-Region filter
Revenue is SUM(Sales[Sales Amount]) (Link below the image)
Dynamic Calculated Column.png
jeroendekk
Resolver IV
Resolver IV

Hi @Oded-Dror 
Calculated columns and tables are calculated on refresh and after that they are static.

 

So a slicers will impact which rows of a table are used but not the content itself. A measure could create this result, but you cannot use measure results in a slicer.

So sorry I do not think this is possible.

Best regards,

Jeroen Dekker

Kumail
Post Prodigy
Post Prodigy

Hello @Oded-Dror 

 

If you could send a sample .pbix that demonstrates what you are looking to get. It would really help to provide you with a quick solution.

 

Regards
Kumail Raza

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.