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

Returning a static column value based on another column

New PowerBi user here. I have a dynamic table with data like this:

 

CategoryGross MarginGross Margin per unitTarget per unit
A3000$3.25?
B200$5?
C500$7.20?
D100$15?

 

In the 4th column I would like to return a static Target Per Unit value depending on the category. Aside from the exception described below, this value would not be affected by slicers; it is set during the annual budgeting process. 

 

One wrinkle is that the data is referencing two consolidated companies, and that choosing one company over another in that particular slicer would need to change the Target per unit, as the Target is different per company for each category.

 

Thanks in advance for your time and help in this. 

3 REPLIES 3
v-eqin-msft
Community Support
Community Support

Hi @gmichalec ,

 

Any updates?

 

Best Regards,
Eyelyn Qin

v-eqin-msft
Community Support
Community Support

Hi @gmichalec ,

 

Sorry for that the information you have provided is not making the problem clear to me. Can you please share more details to help us clarify your scenario?

Like what's the calculated logic of Target per unit? What do you mean it will not be affected by a slicer? The calculated column is indeed static, it will not be changed by selection in slicer. And please show us your expected outputs...

 

Please kindly refer to the blogs to know

How to Get Your Question Answered Quickly - Microsoft Power BI Community

How to provide sample data in the Power BI Forum - Microsoft Power BI Community

 

 

Best Regards,
Eyelyn Qin

amitchandak
Super User
Super User

@gmichalec , Not very clear,

 

You can create a new column like

 

Switch( [Category],

"A", 50,

"B", 20,

"C", 30,

"C", 40 )

 

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.