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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
KH_Mike
Helper III
Helper III

How to change the field value by using DAX

Hi All,

 

Right now I create a table like below. Those fields are in the Table already. I would like to change the value when Table[Cat] = A and Table[Sub-Cat] = CC  to Table[Sub-Cat] = BB. Is it possible to acheive it by just by using DAX formalar (Measure)?

 

Before

CatSub-Catsum(Volume)
AAA0
ABB1
ACC2
BAA3
BBB4
BCC5
CAA6
CBB7
CCC8

 

After

CatSub-Catsum(Volume)
AAA0
ABB3
BAA3
BBB4
BCC5
CAA6
CBB7
CCC8

 

4 REPLIES 4
Jihwan_Kim
Super User
Super User

Picture1.png

 

Volume Total by the condition : =
SWITCH (
TRUE (),
SELECTEDVALUE ( Categories[Cat] ) = "A"
&& SELECTEDVALUE ( Sub_Categories[Sub-Cat] ) = "CC", BLANK (),
SELECTEDVALUE ( Categories[Cat] ) = "A"
&& SELECTEDVALUE ( Sub_Categories[Sub-Cat] ) = "BB",
CALCULATE (
SUM ( Data[sum(Volume)] ),
Categories[Cat] = "A",
Sub_Categories[Sub-Cat] = "BB"
|| Sub_Categories[Sub-Cat] = "CC"
),
SUM ( Data[sum(Volume)] )
)

 

 

Link to the sample pbix file 

 

 


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.
amitchandak
Super User
Super User

@KH_Mike , I DAX you have to create a new column

 

Sub Cat New =

if([Cat]= "A" && [Sub Cat] ="CC", "BB", [Sub Cat])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hi @amitchandak @Jihwan_Kim

 

Is it possible to do it in "Measure" instead of adding new column / create new table behind? Thank you.

Hi,

Please try the below measure.

The columns that are refered in the measure are from the same table.

 

Volume Total by the condition : =
SWITCH (
TRUE (),
SELECTEDVALUE ( Data[Cat] ) = "A" && SELECTEDVALUE ( Data[Sub-Cat] ) = "CC", BLANK (),
SELECTEDVALUE ( Data[Cat] ) = "A" && SELECTEDVALUE ( Data[Sub-Cat] ) = "BB",
CALCULATE (
SUM ( Data[sum(Volume)] ),
FILTER( ALL(Data), Data[Cat] = "A" &&
Data[Sub-Cat] in { "BB","CC"})
),
SUM ( Data[sum(Volume)] )
)
 
 

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.