Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowGet inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.
Hi,
I'm not sure my title is all that descriptive of the problem, but here's what I'm trying to do. My data model contains a date table (Calendar) and a fact table (Historical Quotes and Orders). Calendar is joined to Historical Quotes and Orders on 'Calendar[DATE_DESC] = 'Historical Quotes and Orderes'[TRANSACTION_DATE]. In addition to the field DATE_DESC, Calendar also contains a field titled WEEKDAY_DESC.
I've calculated a measure to calculate the total sales for a period starting 2020-01-01 and ending 2020-03-15, defined as:
# Quoted Sales 2020 Period 1 =
CALCULATE(
'Historical Quotes and Orders'[# Quoted Sales],
DATESBETWEEN(
'Calendar'[DATE_DESC],
DATE(2020, 1, 1),
DATE(2020, 3, 15)
)
)
This works fine and gives the appropriate result. The problem comes in when I try to slice this measure by 'Calendar'[WEEKDAY_DESC]. The measure returns the total value for the period regardless of the selected value from the WEEKDAY_DESC filter. I tried modifying the measure as follows with no luck:
# Quoted Sales 2020 Period 1 =
CALCULATE(
'Historical Quotes and Orders'[# Quoted Sales],
FILTER(
ALLEXCEPT('Calendar', 'Calendar'[WEEKDAY_DESC]),
'Calendar'[DATE_DESC] >= DATE(2020, 1, 1) &&
'Calendar'[DATE_DESC] <= DATE(2020, 3, 15)
)
)
Any thoughts on what might be the issue here?
Thanks!
Solved! Go to Solution.
Instead of DATESBETWEEN(), declare a minimum and Maximum date as variables and then use them in the filter portion of CALCULATE().
Quoted Saled Period 1 =
Instead of DATESBETWEEN(), declare a minimum and Maximum date as variables and then use them in the filter portion of CALCULATE().
Quoted Saled Period 1 =
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code FABINSIDER for a $400 discount!
Check out the February 2025 Power BI update to learn about new features.
User | Count |
---|---|
84 | |
70 | |
66 | |
50 | |
31 |
User | Count |
---|---|
116 | |
99 | |
75 | |
65 | |
40 |