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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Anonymous
Not applicable

Create a Dynamic Measure

Hi, 

I want to create a dynamic measure. I have various colunm with values, whose name is Jar, for example, Color Jar, Smell Jar, Aftertaste Jar, Fizziness Jar etc. 

I created this measure: 

Measure Color = 
                VAR color = 
                           DIVIDE(COUNTA('consumer'[Color JAR]),
                            CALCULATE(COUNTA('consumer'[Color JAR]),
                            ALLEXCEPT(consumer, consumer[preference])),
                            0
                            )
                RETURN
                        color

 And i've this table with these fields:
image.png
and I wanted to add everything in the same table, that is, at the moment for each Jar I have a table, a table for the Jar color, another for the Jar smell, but I wanted to create a dynamic metric that aggregates all the metrics of type:

GENERIC MEASURE = VAR color = 
                            DIVIDE(COUNTA('consumer'[Color JAR]),
                            CALCULATE('consumer'[count color jar],
                            ALLEXCEPT(consumer, consumer[preference])),
                            0
                            )
                            VAR smell = 
                            DIVIDE(COUNTA('consumer'[Smell JAR]),
                            CALCULATE('consumer'[count smell jar],
                            ALLEXCEPT(consumer, consumer[preference])),
                            0
                            )
                            VAR taste =
                            DIVIDE(COUNTA('consumer'[Taste strength JAR]),
                            CALCULATE(COUNTA(consumer[Color JAR]),
                            ALLEXCEPT(consumer, consumer[preference])),
                            0
                            )
                            VAR fizziness = 
                            DIVIDE(COUNTA('consumer'[Fizziness JAR]),
                            CALCULATE(COUNTA(consumer[Fizziness JAR]),
                            ALLEXCEPT(consumer, consumer[preference])),
                            0
                            )
                            VAR bitterness = 
                            DIVIDE(COUNTA(consumer[Bitterness JAR]),
                            CALCULATE(COUNTA(consumer[Bitterness JAR]),
                            ALLEXCEPT(consumer, consumer[preference])),
                            0
                            )
                            VAR alcohol = 
                            DIVIDE(COUNTA(consumer[Alcoholc Leval JAR]),
                            CALCULATE(COUNTA(consumer[Alcoholc Leval JAR]),
                            ALLEXCEPT(consumer, consumer[preference])),
                            0
                            )
                            VAR aftertaste =
                            DIVIDE(COUNTA(consumer[Aftertaste Liking]),
                            CALCULATE(COUNTA(consumer[Aftertaste Liking]),
                            ALLEXCEPT(consumer, consumer[preference])),
                            0
                            )
                            VAR refreshing =
                            DIVIDE(COUNTA(consumer[Refreshing]),
                            CALCULATE(COUNTA(consumer[Refreshing]),
                            ALLEXCEPT(consumer, consumer[preference])),
                            0
                            )
                            VAR easy =
                            DIVIDE(COUNTA(consumer[Refreshing]),
                            CALCULATE(COUNTA(consumer[Easy to drink]),
                            ALLEXCEPT(consumer, consumer[preference])),
                            0
                            )

It's possible? 

Kind regards.

1 REPLY 1
v-frfei-msft
Community Support
Community Support

Hi @Anonymous,

 

Could you please share your sample data and excepted result to me, if you don't have confidential data? Please upload your file to One Drive and share the link here.

 

Regards,

Frank

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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