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 guys,
Can someone help Modify this DAX query
Hi @Anonymous ,
The result of SELECTEDVALUE('Calendar'[Fiscal Year]) is blank due to you only have one field in this table, so the countrows( values( 'Calendar'[Fiscal Year]) >1 of each rows when you do not do some filter outside the table visual.
Or the selectedvalue( 'Calendar'[Fiscal week number]) is blank.
If im wrong, please let me know and share your pbix file without sensitive data.
Best Regards
Community Support Team _ chenwu zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
I never use the function like your function, so I tried yours, and it works.
my function :
weekly Sales LY =
var maxYear = max('Calendar'[Fiscal Year])
var maxWeekNumber = max('Calendar'[Fiscal_week_number])
return
CALCULATE(
[sales],
filter(ALL('Calender'),
'Calendar'[Fiscal Year] = maxYear - 1 &&
'Calendar'[Fiscal_week_number] = maxWeekNumber
)
)
show me your sales function and relationship between tables
@vapid128 My current works perfectly.
I mean [sales]
I tested your way, it should be work.
@vapid128 Still not working for Weekly Sales LY. Do you have know another method?
User | Count |
---|---|
15 | |
12 | |
8 | |
7 | |
7 |
User | Count |
---|---|
24 | |
20 | |
12 | |
9 | |
7 |