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

Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more

Reply
JamesBurke
Helper III
Helper III

Measure that References other Measure based on a conditional Column

Hi All , 

 

I'm looking at making this type of logic into a measure but not sure how to :

 

CC 2 =

If CC 1 = -1 then = 0

If CC 1 = 0 then use "Total Solar"

If CC 1 = 1 then use "Total Cons"

If CC 1 = 2 then use "BSP 1" - "Nursery"

If CC 1 = 3 then use "Art Design" - "MFL & Humanities and Thornton"

If CC 1 = 4 then use "Main School" - "Art & Design"

 

So it refrences a conditonal column that says if CC 1 = A certain value use a different Measure . 

 

Thanks James. 

1 ACCEPTED SOLUTION
SamWiseOwl
Super User
Super User

So CC1 is a calculated column that will appear in the visual and the other items listed are all existing measures?
CC2 =
Switch(
SelectedValue(table[CC1])
,-1, 0

,0, [Total Solar]

,1, [Total Cons]

,2, [BP 1] - [Nursery]

,3, [Art Design] - [MFL & Humanities and Thornton]

,4,[Main School] - [Art & Design]

)

 

 


If you are happy with this answer please mark as a solution for others to find !

Kudos are always appreciated! Check out our free Power BI video courses.

View solution in original post

3 REPLIES 3
v-jianpeng-msft
Community Support
Community Support

Your solution is worked perfect SamWiseOwl 

Hi, @JamesBurke 

I've created this example data:

vjianpengmsft_0-1729133340441.png

I have a cc1 conditional column:

vjianpengmsft_4-1729133612916.png

 

Then use the SamWiseOwl  measure:

CC2 = SWITCH(TRUE(),
SELECTEDVALUE('Table'[CC1]) = -1,0,
SELECTEDVALUE('Table'[CC1]) = 0,[Measure1],
SELECTEDVALUE('Table'[CC1]) = 1,[Measure2],
SELECTEDVALUE('Table'[CC1]) = 2,[Measure3]
)

It works flawlessly:

vjianpengmsft_5-1729134157004.png

 

 

How to Get Your Question Answered Quickly

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

Best Regards

Jianpeng Li

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

Kedar_Pande
Super User
Super User

CC 2 = 
SWITCH(
TRUE(),
[CC 1] = -1, 0,
[CC 1] = 0, [Total Solar],
[CC 1] = 1, [Total Cons],
[CC 1] = 2, [BSP 1] - [Nursery],
[CC 1] = 3, [Art Design] - [MFL & Humanities and Thornton],
[CC 1] = 4, [Main School] - [Art & Design],
BLANK()
)


If this helped, a Kudos 👍 or Solution mark would be great! 🎉
Cheers,
Kedar
Connect on LinkedIn

SamWiseOwl
Super User
Super User

So CC1 is a calculated column that will appear in the visual and the other items listed are all existing measures?
CC2 =
Switch(
SelectedValue(table[CC1])
,-1, 0

,0, [Total Solar]

,1, [Total Cons]

,2, [BP 1] - [Nursery]

,3, [Art Design] - [MFL & Humanities and Thornton]

,4,[Main School] - [Art & Design]

)

 

 


If you are happy with this answer please mark as a solution for others to find !

Kudos are always appreciated! Check out our free Power BI video courses.

Helpful resources

Announcements
March PBI video - carousel

Power BI Monthly Update - March 2025

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

March2025 Carousel

Fabric Community Update - March 2025

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

Top Solution Authors