Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now
Hi ,
Looking to determine the effect of certain events on sales e.g. promotion of product.
e.g. have sales table and rows which flagged if sale occured during event e.g promotion of a product
customer
, product
, sales_qty
, sale_date
, 'Promotion active_flag'
example data
joe bloggs
, beans
,10
,'01-jun-2020'
,'Promotion Active'
joe bloggs
, beans
,2
,'01-MAY-2020'
'No promotion'
Want to see sales of these
User can select sales date e.g. if select 01-jun-2020' onwards t0 '30-jun-2020', have below
However, if say user selects as partciular date, only want the avarge in formula below to take into account the corresponding day of week. How can we best achieve this?
@po
Can you explain this part?
"However, if say user selects as partciular date, only want the avarge in formula below to take into account the corresponding day of week. How can we best achieve this?"
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
Hi,
Use this measure:
Sales Before Promo Avg same Week Day =
VAR _WeekDay = WEEKDAY(SELECTEDVALUE(Sales[Sales Date]))
RETURN
CALCULATE(
AVERAGE(Sales[Sales Qty]),
Sales[Descriptor]="Before promotion",
FILTER(ALL(Sales),WEEKDAY(Sales[Sales Date])=_WeekDay)
)
If you are satisfied with my answer, please mark it as a solution so others can easily find it.
APPRECIATE KUDOS!
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
Thanks - will give it a try
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
93 | |
89 | |
84 | |
70 | |
49 |
User | Count |
---|---|
141 | |
120 | |
112 | |
59 | |
59 |