Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi ,
Please help me on below problem:
I have one data set in which brands and respective their respective search values are there. And I have another dataset in which I have done unpivoting and have one column name as Attributes and other as Values. Based on these Attributes values are present and their respective brand is present.
Now, I need to implement a relation between these two datasets as if in 'Data2', Attributes = A then Values should be > 0 and based on this brands should pick in the table.
Attributes would be in Slicer (A,B,C and D as dropdown). In Table in Rows as "Brand" variable . But when I select "A" in Slicer then in table I should see only sub categories of A same with B, C and D.
Brand | SI | A | B | C | D |
B | 0.839881 | 0 | 1 | 0 | 0 |
Bb | 6.514407 | 0 | 2 | 0 | 0 |
Bbb | 0.03975 | 0 | 3 | 0 | 0 |
A | 1.0485 | 1 | 0 | 0 | 0 |
Aa | 0.449527 | 2 | 0 | 0 | 0 |
Aaa | 0.36436 | 3 | 0 | 0 | 0 |
C | 2.125201 | 0 | 0 | 1 | 0 |
Cc | 2.168612 | 0 | 0 | 2 | 0 |
Ccc | 2.037037 | 0 | 0 | 3 | 0 |
Dd | 8.476445 | 0 | 0 | 0 | 2 |
D | 2.224267 | 0 | 0 | 0 | 1 |
Ddddd | 0.034427 | 0 | 0 | 0 | 5 |
Dataset2 (unpivot)
Brand | SI | Attributes | Values |
B | 0.839881 | B | 1 |
Bb | 6.514407 | B | 2 |
Bbb | 0.03975 | B | 3 |
A | 1.0485 | A | 1 |
Aa | 0.449527 | A | 2 |
Aaa | 0.36436 | A | 3 |
C | 2.125201 | C | 1 |
Cc | 2.168612 | C | 2 |
Ccc | 2.037037 | C | 3 |
Dd | 8.476445 | D | 2 |
D | 2.224267 | D | 1 |
Ddddd | 0.034427 | D | 5 |
Please suggest.
Solved! Go to Solution.
Hi @SK87 ,
Here are the steps you can follow:
1. Create calculated table.
Slicer_Date =
DISTINCT('Table2'[Attributes])
2. Create measure.
Flag =
var _select= SELECTEDVALUE('Slicer_Date'[Attributes])
var _mindate=MINX(
FILTER(ALL('Table2'),'Table2'[Attributes]=_select),
[Values])
return
SWITCH(
TRUE(),
MAX('Table2'[Attributes])=_select&&MAX('Table2'[Values])>_mindate,1,
MAX('Table2'[Attributes])<>_select&&MAX('Table2'[Values])>_mindate,1,0
)
3. Place [Flag]in Filters, set is=1, apply filter.
4. Result:
If you need pbix, please click here.
If I have misunderstood your meaning, please provide your desired output and pbix without privacy information.
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi @SK87 ,
Here are the steps you can follow:
1. Create calculated table.
Slicer_Date =
DISTINCT('Table2'[Attributes])
2. Create measure.
Flag =
var _select= SELECTEDVALUE('Slicer_Date'[Attributes])
var _mindate=MINX(
FILTER(ALL('Table2'),'Table2'[Attributes]=_select),
[Values])
return
SWITCH(
TRUE(),
MAX('Table2'[Attributes])=_select&&MAX('Table2'[Values])>_mindate,1,
MAX('Table2'[Attributes])<>_select&&MAX('Table2'[Values])>_mindate,1,0
)
3. Place [Flag]in Filters, set is=1, apply filter.
4. Result:
If you need pbix, please click here.
If I have misunderstood your meaning, please provide your desired output and pbix without privacy information.
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
@SK87 I don't think you need a relationship. Everything you need is already in the unpivot dataset. I just added a brand category group there. Check out this sample file: Relationship between two datasets through Measures (DAX) 2022-07-10.pbix
Thanks for your response.
I had shared an example table, brand names are not synchronised. I can't use left function for brand category.
brand names are of shoes like Nike, Adidas, Converse etc.So this solution is not correct for my dataset.
Kindly suggest something else if possible.
@SK87 can you sharea sample of your real data and also the desired graph result. If not, PM me