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
Nazdac911
Helper II
Helper II

Using DAX, not calculated columns. Getting another value if text column contains specified value

Hi All 

I faced the following challenge

From the following virtual table I want to be able to filter through 3 slicers [ City , Store, Category]

Nazdac911_0-1667848416959.png

and then showing the following results:

Nazdac911_2-1667848677608.png

 

  • Field: Shows a different values than the existing values depend on conditional equation (Switch or If)
  • Profit: Sum(table[Profit])
  • Units: Changes depends on slicers

The challenge is to be able to change the column values depend of their contents and  show updated values in the resulted table.

PS, I don’t have permission to create calculated columns , so this should  be done with DAX measures.  

Thanks in advance 

Regards 

1 ACCEPTED SOLUTION

Hi @Nazdac911 ,

 

Is it probably similar to this format?(the data I use are different from yours)

vmengzhumsft_0-1669194268034.png

create the following measure:

PRD = IF('Table'[field]="product 1 high quality","PRD 1",IF('Table'[field]="product 2 high quality","PRD 2","PRD 3"))
profits = CALCULATE(SUM('Table'[profit]),FILTER(ALL('Table'),'Table'[PRD]=SELECTEDVALUE('Table'[PRD])))

 

You can also refer to my pbix file for better understanding.

 

Best regards,

Community Support Team Selina zhu

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

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@Nazdac911 , Can you give example of what values you want to show here

 

  • Field: Shows a different values than the existing values depend on conditional equation (Switch or If)

 

Thanks for the fast reply 

For example : if I have "Product 1 high quality value " then show in the report "Prd 1" 

in other word , insted of draging a column to the table visual , i need to use a mesure that will change tests in the column

I hope this answer your question 🙂 

Looking forward hearing form you

Regards

Hi @Nazdac911 ,

 

Is it probably similar to this format?(the data I use are different from yours)

vmengzhumsft_0-1669194268034.png

create the following measure:

PRD = IF('Table'[field]="product 1 high quality","PRD 1",IF('Table'[field]="product 2 high quality","PRD 2","PRD 3"))
profits = CALCULATE(SUM('Table'[profit]),FILTER(ALL('Table'),'Table'[PRD]=SELECTEDVALUE('Table'[PRD])))

 

You can also refer to my pbix file for better understanding.

 

Best regards,

Community Support Team Selina zhu

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

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.

Top Solution Authors