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 to sum days along with month like this
day, sumByDay, SumByMonth
01/01/2022 10, 25
02/01/2022 12, 25
03/01/2022 3 , 25
01/02/2022 9 , 11
02/02/2022 2 , 11
My problem is the filter context
when i use remove all
its give me all dates but i need only for that month
how can i achive that?
Thanks alot
Solved! Go to Solution.
A seemly simple solution, but the mechanism under the hood is complex enough.
Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! |
DAX is simple, but NOT EASY! |
Thanks CNENFENL
Looks good.
Hi @Urielpc ,
Please try:
Measure = CALCULATE(SUM('Table'[Value]),FILTER(ALL('Table'),YEAR([Day])=YEAR(MAX('Table'[Day])) && MONTH([Day])=MONTH(MAX('Table'[Day]))))
Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
A seemly simple solution, but the mechanism under the hood is complex enough.
Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! |
DAX is simple, but NOT EASY! |
Make sure that you have a Year Month column on your date table then use
Sum by Month =
var currentMonth = SELECTEDVALUE( 'Date'[Year Month])
return CALCULATE( [Base measure], REMOVEFILTERS('Date'), 'Date'[Year Month] = currentMonth )
User | Count |
---|---|
13 | |
8 | |
7 | |
6 | |
5 |
User | Count |
---|---|
21 | |
15 | |
15 | |
10 | |
7 |