Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
I have a list of items with pricing as value by delivery date. Because the direct query data has multiple duplicated entries per items, the row subtotal shows 10X more than what it should be. If I create a new measure with rank to bring most recent data shown to make the subtotal, what should it be? Thank you in advance.
This is what I thought to use rankx
Rank =
RANKX(ALL(Hub,Item),Item Cost)
Hi @sunah132
I took a look at the pbix file you provided, and the current rendering is as follows. What is the result you need, could you explain it? From the data you provide so far, I am not particularly clear about your needs.
Best Regards
Community Support Team _ Ailsa Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Ailsa,
There are multiple duplicated data per item and I had to bring the minimum cost of the table per day to sum up the total. There were daily pricing and misc. pricing on every Wednesday that I had to put together into the table with minimums on it. I tried tweaking Ryan's DAX to both charges added onto it but I was struggling getting them calculated. Thank you for look into this!
@sunah132 ,Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.
You can get last price for an item like
Measure =
VAR __id = MAX ('Table'[item] )
VAR __date = CALCULATE ( MAX('Table'[Date] ), ALLSELECTED ('Table' ), 'Table'[item] = __id )
CALCULATE ( max ('Table'[price] ), VALUES ('Table'[item] ),'Table'[item] = __id,'Table'[Date] = __date )
Thank you, I have attached a new example about this.
you can try this
Measure 2 =
var TBL=SUMMARIZE('Sheet1',Sheet1[Date],Sheet1[Item],Sheet1[Item code],"min",min(Sheet1[Item Cost]))
RETURN SUMX(TBL,[min])
please see the attachment below
Proud to be a Super User!
Thank you!! It applied as I was expected!
If there's a miscellaneous cost on every Wednesday per item code, may I add like this?
var TBL=SUMMARIZE('Sheet1',Sheet1[Date],Sheet1[Item],Sheet1[Item code],"min",min(Sheet1[Item Cost],(sheet1[Misc cost]))
RETURN SUMX(TBL,[min])
I can't access to the link you shared. could you pls share via dropbox?
Proud to be a Super User!
Yes, Sorry. Here is the dropbox link below.
I can download your pbix file. what's the expected output?
Proud to be a Super User!
Hello,
As the table below, I tried to see if I can add the MIN of Misc charge add up with the item cost if they were on the same delivery date. Thank you very much!
you can try this
Measure =
var TBL=SUMMARIZE('Sheet1',Sheet1[Date],Sheet1[Item],Sheet1[Item code],"min",min(Sheet1[Item Cost])+min(Sheet1[Misc Cost]))
RETURN SUMX(TBL,[min])
Proud to be a Super User!
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
110 | |
99 | |
80 | |
64 | |
57 |
User | Count |
---|---|
145 | |
110 | |
91 | |
84 | |
66 |