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

Creating a dimension based on measures

Greetings,

 

I currently have a list of products with associated measures - see example below:

 

Product        Actual          Budget        Variance         Abs Variance

A                  100               90               +10                 10

B                  200               250              (50)                 50

C                  150               175              (25)                 25

 

I created a measure that allows me to aggregate the products based on the size of variance (selected in a separate slicer).  Based on that selection, I want to create a new dimension of the product names.  For example, if a project has a absolute value variance > 30, what I'd like to see is:

 

 

Product        Actual          Budget        Variance       Abs Variance      Revised_Product Name

A                  100               90               +10              10                       All Other

B                  200               250              (50)              50                       B

C                  150               175              (25)              25                       All Other

 

I am not sure why the following syntax doesn't work.  When I write the formula, I am not able to "call up" the column of product names:

 

Revised_Product Name = SWITCH (

                                                   TRUE( ),

                                                       [Abs Variance] <= [Selected Variance Size], "All Other",

                                                       'Table'Product

                                                         )

 

Thanks for any insights.

2 ACCEPTED SOLUTIONS
Anonymous
Not applicable

Revised_Product Name =
IF( HASONEFILTER( Table[Product] ),
	IF(
	    [Abs Variance] <= [Selected Variance Size],
	    "All Other",
	    SELECTEDVALUE( Table[Product] )
	)
)

Best

D

View solution in original post

Many thanks - this worked perfectly!

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Revised_Product Name =
IF( HASONEFILTER( Table[Product] ),
	IF(
	    [Abs Variance] <= [Selected Variance Size],
	    "All Other",
	    SELECTEDVALUE( Table[Product] )
	)
)

Best

D

Many thanks - this worked perfectly!

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.