The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event! Join us in Stockholm, Sweden from September 24-27, 2024.
2-for-1 sale on June 20 only!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Hi,
I have a dataset of Date - Month - Product - Category where there are 3 categories and around 40 products.
I want to assign a cost only for the first occurence of each product in each month based on the category they belong to. Note that "Product" is not unique. Any advice for how to implement that?
Thanks for help!
Solved! Go to Solution.
Hi @Mal1
Although, i don't know how to assign a cost for the first occurence of product, i can figure out which ones are the first occurence of product.
Look at my test,
First sort the table by "date" column (Modeling->Sort by column),
Second, in query editor,create an index column from 1,
Third, create calculated columns below
minvalue = CALCULATE(MIN([Index]),ALLEXCEPT(Sheet1,Sheet1[Category],Sheet1[Month],Sheet1[Product]))
firstoccurence = IF([minvalue]=[Index],[Product])
Best Regards
Maggie
Hi @Mal1
Although, i don't know how to assign a cost for the first occurence of product, i can figure out which ones are the first occurence of product.
Look at my test,
First sort the table by "date" column (Modeling->Sort by column),
Second, in query editor,create an index column from 1,
Third, create calculated columns below
minvalue = CALCULATE(MIN([Index]),ALLEXCEPT(Sheet1,Sheet1[Category],Sheet1[Month],Sheet1[Product]))
firstoccurence = IF([minvalue]=[Index],[Product])
Best Regards
Maggie
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the June 2024 Power BI update to learn about new features.
User | Count |
---|---|
105 | |
97 | |
80 | |
62 | |
57 |
User | Count |
---|---|
246 | |
119 | |
114 | |
87 | |
70 |