Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now
Hi,
I enconter Power BI issue with Filter function.
1st Step: I try to add a Calendar table:
Not sure what is the requirement here. However the issue is FILTER('Calender','Calender'[Date Value] . Filter as Calculated Column start a new Row Context. So basically it is getting evaluated for each row of base table.
Also, Filter returns a Table. So, you are trying to insert a Table for each row of Calendar table as Column that is not allowed. To verify this, you can see below.
Filter_3 = COUNTROWS(FILTER('Calender','Calender'[Date Value]>=CALCULATE(MIN('Calender'[Date Value]),FILTER('Calender','Calender'[Year]=YEAR(NOW())))))
In Filter_4 - You are creating a Table using Filter that is perfectly fine.
Thanks
Ankit Jain
Do Mark it as solution if the response resolved your problem. Do like the response if it seems good and helpful.
Dear Anki,
Thanks for your reply. Sorry for my unclear discription.
my problem is filter_3 works very well.
Filter_3 = FILTER('Calender','Calender'[Date Value]>=CALCULATE(MIN('Calender'[Date Value]),FILTER('Calender','Calender'[Year]=YEAR(NOW()))))but it is too long. I try to copy part of above measure to create a new one and name it as LD:
LD = CALCULATE(MIN('Calender'[Date Value]),FILTER('Calender','Calender'[Year]=YEAR(NOW())))and create new Filter_4 using below code:
Filter_4 = FILTER('Calender','Calender'[Date Value]>=[LD])Since these two code should be same. I expect the Same result of Filter_3 and Filter_4. But Filter_4 table show all of the orginal Calender table, which means it do not aplly any filter that I set of "LD".
Hi - I can't tell exact reason why but to me it seems using this way in Filter 4, Measure LD is returning blank and hence you getting all the values. For your requirement, you can simply use below.
Table 2 = FILTER(Calender,YEAR(Calender[Date]) >= YEAR(NOW()))
Thanks
Ankit Jain
Do Mark it as solution if the response resolved your problem. Do like the response if it seems good and helpful.
Check out the October 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
112 | |
107 | |
99 | |
91 | |
69 |
User | Count |
---|---|
173 | |
135 | |
131 | |
96 | |
94 |