Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.
Hi,
I have a table where I need to average out time stamped values. I want to filter this table by the product ID's contained in another table. Both the time stampped table and the other table contraining product ID's are related using a product lookup table.
I've treid to use CALCULATE, but I keep getting errors. I know I can make this work if I type in all the product ID's manually, but obiously this is not practical.
Any tips?
Solved! Go to Solution.
@numersoz , Try like
calculate(sum(table1[Values]),filter(Table1, Table1[Product ID] in Values(Table2[Product ID])))
calculate(sum(table1[Values]),filter(Table1, Table1[Product ID] in allselected(Table2[Product ID])))
or try treatas
https://docs.microsoft.com/en-us/dax/treatas-function
Hi,
Measure = CALCULATE(AVERAGE('Data Hourly'[Amount]), EXCEPT(VALUES('Data Hourly'[productName]), VALUES('Target'[productID])))
My tables are as such:
Data Hourly has one to many relationship with productTable using productName.
productTable has one to one relationship with Target using productID.
I want to plot amount and target, however as target table does not have all of the products, I want to plot only for the product's that exists in the target table. The problem I have is, the plot of amount is also showing products that are not part of the target table.
@numersoz , Try like
calculate(sum(table1[Values]),filter(Table1, Table1[Product ID] in Values(Table2[Product ID])))
calculate(sum(table1[Values]),filter(Table1, Table1[Product ID] in allselected(Table2[Product ID])))
or try treatas
https://docs.microsoft.com/en-us/dax/treatas-function
Hi @numersoz
Please post sample i/p and o/p data.
My hunch is that it is due to the way your table is joined. either one to many or many to many.
Hope it resolves your issue? Did I answer your question? Mark my post as a solution! Appreciate your Kudos, Press the thumbs up button!! Linkedin Profile |
@numersoz - Not really enough information to go on, please first check if your issue is a common issue listed here: https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882
Also, please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
The most important parts are:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2.
Check out the November 2023 Power BI update to learn about new features.
Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.