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.
Hi Power BI Community,
I wanted to get the values/sales of only for the latest product that lunched.
Date | Product | Sales |
12/03/2022 | 12.03.2022012 | 42 |
18/07/2022 | 18.07.2022023 | 10 |
25/08/2022 | 25.08.2022031 | 56 |
25/08/2022 | 25.08.2022045 | 59 |
10.10.2022 | 10.10.2022067 | - |
This is a dummy table and values, but my original dataset has the same formate with product names. As you can see on Date basis new products are lunching.
Sometimes on same date, new product lunches and I only want to consider the latest one. Like 25.08.2022031 and 25.08.2022045 are lunched on same date, I just want the sales of 045 = 59 sales. And later on in future new product came (10.10.2022067), the selected values should be fetched for that new product.
Thank you
@Anonymous Try this:
Measure =
VAR __LastDate = MAX('Table'[Date])
VAR __Table = FILTER('Table',[Date] = __LastDate)
VAR __LastProduct = MAXX(__Table,[Product])
RETURN
SUMX(FILTER(__Table, [Product] = __LastProduct),[Sales])
Hi @Greg_Deckler ,
This is not working.
This DAX query only getting the sales value of first date only(12.03.2022012). Not the latest date.
I want to get the value of 25.08.2022045. The current latest one
@Anonymous See attached PBIX file below signature. The slightly modified measure below works for me and gets the last date value. Not, the modifications were due to the "-" and thus the assumption that the sales are text.
Measure =
VAR __LastDate = MAXX(FILTER('Table',[Sales] <> "-"),[Date])
VAR __Table = FILTER('Table', [Date] = __LastDate)
VAR __LastProduct = MAXX(__Table,[Product])
RETURN
MAXX(FILTER(__Table, [Product] = __LastProduct),[Sales])
Hi @Greg_Deckler ,
I also tried it in my dataset, but still giving me the total values rather than latest product value
In here you can see that product is changing from Yellow to Blue one
what I need is that when for example blue one lunched, DAX query should start summing pageviews only for blue one and if new product lunches after that it should only sum pageviews for that one
Also, I wanted to consider the pages/products that lunches for the year i.e., 2022 and so on. (But i think this is not necessary)
Thank you
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 |
---|---|
49 | |
27 | |
20 | |
15 | |
12 |
User | Count |
---|---|
58 | |
50 | |
44 | |
19 | |
18 |