March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hi,
I have a situation where i have two tables: Category and Products. I want to combine these to a visual. However, this would require a relationship that links Product 1,2,3,4 to "Products" category. I could just create a calculated column for this, but that would be redundant.
Can i create this relationship with DAX? How?
Solved! Go to Solution.
Hi @CarlsBerg999 ,
Based on your description, I create a measure as follows.
test =
SUMX(FILTER(ALL('Products'),LEFT(MAX('Products'[Products]),3)=LEFT(SELECTEDVALUE('Categories'[Categories]),3)),[Price])
Result:
Hope that's what you were looking for.
Best Regards,
Yuna
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @CarlsBerg999 ,
Based on your description, I create a measure as follows.
test =
SUMX(FILTER(ALL('Products'),LEFT(MAX('Products'[Products]),3)=LEFT(SELECTEDVALUE('Categories'[Categories]),3)),[Price])
Result:
Hope that's what you were looking for.
Best Regards,
Yuna
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
The ideal step will be create a Key column then make a relationship by virtual or physical..
if you dont want to create any column then simple Switch or if statement also will help you to acheive this
Attached is the .pbis file for your reference
https://dropfiles.org/Z5M3DH7C
Hope it will help
Regards
sanalytics
@CarlsBerg999 , Created a calculated column is an idea going to work here. Is the service also have data coming from another table?
Yes, I would like to avoid making calculated columns. Isn't there a way to create this relationship with a measure?
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
129 | |
90 | |
75 | |
58 | |
53 |
User | Count |
---|---|
200 | |
104 | |
101 | |
67 | |
55 |