The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hello,
I have a slicer setup to show transactions over the last one calendar week.
This works great to show the product that was purchased on that transaction.
However, I would also like a visual to show how many times that product was purchased over the last 5 years.
Any help is greatly appreciated.
It's a single table with 'Transaction#' as the unique identifier. I'm using a on the slicer that shows relative date, last one calendar week. I coped a column for 'TransactionDateTime' and transformed it to date only which is what you see in the screenshot above (and what I am also using in the slicer filter) . I want to display some specific transaction data along with some weekly data which I have been able to do. The last thing I need to do is show how many times that product has been purchased over the last 5 years.
Try this measure in a card visual
Measure =
VAR baseDate_ = [TransactionDate] //The measure you already have and show in the card visual
VAR startOfPeriod_ =
EDATE ( baseDate_, -5 )
VAR product_ = [Product] //The measure you already have and show in the card visual at the top
RETURN
CALCULATE (
DISTINCTCOUNT ( Table1[Transaction#] ),
FILTER ( ALL ( DateT ), DateT[Date] >= startOfPeriod_ )
)
Please mark the question solved when done and consider giving a thumbs up if posts are helpful.
Contact me privately for support with any larger-scale BI needs, tutoring, etc.
Cheers
I wasn't notified of your last response. Seems to be a problem with the notifications.
[Product] = SELECTEDVALUE( Table1[ProductID] )
[TransactionDate] = SELECTEDVALUE( Table1[TransactionDate] )
If you share the pbix it would be easier to come up with a more accurate solution
Please mark the question solved when done and consider giving a thumbs up if posts are helpful.
Contact me privately for support with any larger-scale BI needs, tutoring, etc.
Cheers
Thanks AIB.
I do not have 'TransactionDate' and 'Product' setup as measures. They're simply fields from the table.
I wouldn't even begin to know how to make those measures in this case. Maybe I'm biting off more than I can chew right now.
Hi @OEUSOC ,
If possible,could you pls upload your .pbix file to onedrive business and share the link with us?
Remember to remove the confidential information.
Best Regards,
Kelly
Did I answer your question? Mark my post as a solution!
Hi @OEUSOC
What field(s) define how many times a product was purchased? Waht are you using to specify the week, a slicer of a field of a date table? It would help if you show a sample of the relevant tables
Please mark the question solved when done and consider giving a thumbs up if posts are helpful.
Contact me privately for support with any larger-scale BI needs, tutoring, etc.
Cheers
User | Count |
---|---|
77 | |
76 | |
36 | |
31 | |
29 |
User | Count |
---|---|
93 | |
79 | |
57 | |
48 | |
48 |