The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
Hi,
I have a pretty simple model (relation on FL column).
What I need is to be able to pass tag values from dim_FL table (when SFL is selected) into fact_price table and calculate price_pm sum for all Tags of those values. In short, I need to get some kind of list (or summary) of tags from dim table and check which Tags match in fact table and then sum them up.
What would be the best way to do it?
Solved! Go to Solution.
Hi @Anonymous ,
Based on my test, I think the best method might be creating a new calculated table with the relationship between tags.
The new table can be achieved by creating a calculation table, click New Table and enter the table name.
new fact_price = 'fact_price'
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Anonymous
Since you have a relationship defined here, you can insert a table visual and add TAGS column and create a simple measure to sum like Total Price = fact_price[price_pm] then add it as well. Add a slicer for the SFL column.
It should give you the correct value.
If this is not what you are expecting, please share the expected output
________________________
If my answer was helpful, please click Accept it as the solution to help other members find it useful
Click on the Thumbs-Up icon if you like this reply 🙂
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
@Fowmy ,
Thanks for your reply. I am aware that due to the existing relationship fact table will be filtered when SFL is selected, but this is not what I really need.
I need that summing up would be done for all same Tags in fact table regardless of their connection to SFL. The dim table in this case should be used to extract necessary tag values (when SFL is selected), and then passed them on to fact table to do the sum.
Here is what I need to sum up in fact table when, for example, SFL_2 is selected in dim table:
Sum up should be done for all same Tags
Hi @Anonymous ,
Based on my test, I think the best method might be creating a new calculated table with the relationship between tags.
The new table can be achieved by creating a calculation table, click New Table and enter the table name.
new fact_price = 'fact_price'
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
Thank you for your reply.
I believe that your solution works, but I already found another way that also worked for me. It resulted in removing the reltionship between the tables, and then DAX for passing in Tag values is
CALCULATE (
SUM ( 'fact_price'[price_pm] ),
FILTER ( 'fact_price',
[Tag] IN VALUES ( 'dim_FL'[tag] )
&& [price_pm] <> BLANK ()
)
)
Thank you for your help.
Regards,
Ilma
User | Count |
---|---|
69 | |
68 | |
65 | |
54 | |
28 |
User | Count |
---|---|
112 | |
82 | |
65 | |
48 | |
43 |