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 team, I am not sure if this can be done but I assume we should have a way to do it:
I have two slices come from the same table: segment slice and Week Slice. What I want to do is when the user select any week, I have a measure calacute the previous week's order amout. If I chose more than two sengments the measure should calculate the last week's order amount for two segments.
the dax measure I have is
Solved! Go to Solution.
I have figuered out the right way, just put it here in case others come across the same issue:
Hi @Anonymous ,
Glad that you have solved this problem! Could you please mark the correct reply as the standard answer to help the other members find it more quickly.Thank you very much for your kind cooperation!
Hope it helps,
Community Support Team _ Caitlyn Yan
If this post helps then please consider Accept it as the solution to help the other members find it more quickly.
@Anonymous , You should prefer the date table, joined to your table. Then all will not disturb youe formula
But if CUSTOMER_SEGMENT not independent, it should autmatically filter
Try like
EDW_Accounts_PreviousWeek =
var SelectedWeek_privious=SELECTEDVALUE(order[Week_Rank])-1
return
CALCULATE(
count(order[order_num]),
FILTER(all(order),order[Week_Rank]=SelectedWeek_privious && order[CUSTOMER_SEGMENT] in allselected(order[CUSTOMER_SEGMENT])
)
)
I think this should work
EDW_Accounts_PreviousWeek =
var SelectedWeek_privious=SELECTEDVALUE(order[Week_Rank])-1
return
CALCULATE(
count(order[order_num]),
FILTER(all(Date),Date[Week_Rank]=SelectedWeek_privious
)
)
I have figuered out the right way, just put it here in case others come across the same issue:
Hi, I tried the code below and didnt get any luck. The reason I am not using the date table is becuase my visuals contains few tables which the start dates are differernt, so it is hard to defind the week rank. Is there any other method I could try? thanks advance!
EDW_Accounts_PreviousWeek =
var SelectedWeek_privious=SELECTEDVALUE(order[Week_Rank])-1
return
CALCULATE(
count(order[order_num]),
FILTER(all(order),order[Week_Rank]=SelectedWeek_privious && order[CUSTOMER_SEGMENT] in allselected(order[CUSTOMER_SEGMENT])
)
)
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 |
---|---|
115 | |
99 | |
86 | |
70 | |
62 |
User | Count |
---|---|
151 | |
120 | |
103 | |
87 | |
68 |