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 September 15. Request your voucher.
Hi,
I have a table of dates and respective values associated with the dates:
I have created a DAX formula that returns the max values among dates 12th and 14th:
But when I add the date field it returns the values for those 2 dates i.e. 12th and 14th
Solved! Go to Solution.
When you place a column in a visual it acts as a filter. The subset of sales table that is visible in the first row is slready filtered to the date in the same row and so on. ALL removes the filter snd returns the complete table.
Hi @rido
please try
highlight2 =
MAX (
SUMX (
FILTER ( ALL ( sales ), sales[date] = DATE ( 2021, 03, 12 ) ),
sales[unit_sales]
),
SUMX (
FILTER ( ALL ( sales ), sales[date] = DATE ( 2021, 03, 14 ) ),
sales[unit_sales]
)
)
Hello,
Thank you for the response 🙂
I can see that the updated formula returns the max value among all the dates for each date but I just wanted to understand why the original formula returned the values associated with the 2 dates only when the date field had been introduced.
When you place a column in a visual it acts as a filter. The subset of sales table that is visible in the first row is slready filtered to the date in the same row and so on. ALL removes the filter snd returns the complete table.
Yes, that seems like it.
Thanks a lot! 🙂
User | Count |
---|---|
14 | |
11 | |
8 | |
6 | |
5 |
User | Count |
---|---|
28 | |
19 | |
14 | |
8 | |
5 |