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 All,
We are trying to compare sales on Product across Months in the same chart.
Is it possible to do this dynamically in Power BI based on what products are selected in a slicer?
For Example, If Product A started on January 2017 then that would be considered Month 1 for Product A.
While Product B start on July 2019 then that would be considered Month 1 for Product B.
Chart would look like below:
Solved! Go to Solution.
Hi, @acbg
I create a sample. You need to create a calculated column.
Like this:
MONTHCOLUMN =
VAR a =
RANKX (
FILTER ( Table1, [product] = EARLIER ( Table1[product] ) ),
YEAR ( Table1[DATE] ) * 100
+ MONTH ( Table1[DATE] ),
,
ASC,
DENSE
)
RETURN
"month" & a
Best Regards
Janey Guo
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @acbg
I create a sample. You need to create a calculated column.
Like this:
MONTHCOLUMN =
VAR a =
RANKX (
FILTER ( Table1, [product] = EARLIER ( Table1[product] ) ),
YEAR ( Table1[DATE] ) * 100
+ MONTH ( Table1[DATE] ),
,
ASC,
DENSE
)
RETURN
"month" & a
Best Regards
Janey Guo
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@acbg well yes that can be done, it is all going to come down to DAX and disconnected tables but very much possible.
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
@parry2k Thank you for the confirmation. Would you be able to advise how I can achieve this via dax? which dax statement I would use?
@acbg yes for this kind of cohort analysis, you need to create a table that will contain, product, date, and calculated month number based on the product start date, and then it is going to be straightforward. A lot of heavy lifting will be done on data modelling and this calculated table.
Check my latest blog post Comparing Selected Client With Other Top N Clients | PeryTUS I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!
⚡Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.⚡
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
@parry2k Thank you! Is there a way to do this more dynamically via Dax? As this was just an example. I have a lot more complex where they want the start dates to be dynamic based on different slicers. Hence the months will change based on different slicers selected.
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 |
---|---|
113 | |
97 | |
85 | |
70 | |
61 |
User | Count |
---|---|
151 | |
121 | |
104 | |
87 | |
67 |