The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hi all,
I come to you because i have a big problem and i don't have any solution after many hours of searching on the web.
Here is my problem:
=> I want to attribute radomly a value from an other table in a column
The MCD:
The currently reporting:
The wanted result for the grid is only 3 lines (not 6 with duplicate):
- F2318,PRIVILEGES,Name16,FF6949
- F2318,PRIVILEGES,Name26,FF6959
- F2318,PRIVILEGES,Name6,FF6949
The repartition of Code_Promo can be different but i want them ramdom from the list "Code Promo" filtered.
Thank you very much !!!
Solved! Go to Solution.
Hi @ADA371 ,
My Sample is as below and I can reproduce your issue.
Ref_Havea_Promo:
Client:
Relationship:
I think your issue is caused by data model. If you want to get data without duplicate, I think there should be more conditons in two tables. According to your statement, I think there should be a unique column in both tables like [Date] to determind which name is connected to which Code_Promo.
New Table looks like as below.
Ref_Havea_Promo:
Client:
Measure:
Measure = CALCULATE(MAX(Ref_Havea_Promo[Code_Promo]),FILTER(Ref_Havea_Promo,Ref_Havea_Promo[Date] = MAX(Client[Date])))
Result is as below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @ADA371 ,
My Sample is as below and I can reproduce your issue.
Ref_Havea_Promo:
Client:
Relationship:
I think your issue is caused by data model. If you want to get data without duplicate, I think there should be more conditons in two tables. According to your statement, I think there should be a unique column in both tables like [Date] to determind which name is connected to which Code_Promo.
New Table looks like as below.
Ref_Havea_Promo:
Client:
Measure:
Measure = CALCULATE(MAX(Ref_Havea_Promo[Code_Promo]),FILTER(Ref_Havea_Promo,Ref_Havea_Promo[Date] = MAX(Client[Date])))
Result is as below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Let's say you have five promos. Add a column to the Client table with a random number between 1 and 5 (or 0 and 4) and then lookup the corresponding promo.
Do not actively join the tables. (inactive relationship is ok).