Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

Slicer instead of filter with calculated column

Hi,

 

The table below shows the amount of breakdowns for a specific date range with the report details.
DepannageID is unique, LiftID (LiftNaam) is not. "Aantal" shows the total amount of breakdowns with the active filters.

(5 rows with the same LiftID = 5)

pbi.png

I currently have a filter to get the total amount of items based on a time range.

 

Aantal = CALCULATE(
	COUNT(
		'F_DEPANNAGEANALYSE'[LiftID]
	);
	FILTER(
		'F_DEPANNAGEANALYSE';
		EARLIER(
			'F_DEPANNAGEANALYSE'[LiftID]
		) = 'F_DEPANNAGEANALYSE'[LiftID]
	);
	FILTER (
        'F_DEPANNAGEANALYSE',
            DATE(YEAR(NOW());MONTH(NOW())-6; DAY(NOW())) <= F_DEPANNAGEANALYSE[DepannageUitgevoerdDatumtijd]
            && F_DEPANNAGEANALYSE[DepannageOproepDatumtijd] <= DATE(YEAR(NOW());MONTH(NOW()); DAY(NOW()))
    ),
    all('F_DEPANNAGEANALYSE')
)

So the date range filter is not working on the last "Aantal" column. I currently hard coded the date range.
Is there any way to achieve this? I already tried a lot of suggestions on the forums (both measured and calculated table based).

Short: i am looking for an OUTER APPLY alternative in DAX (since i am not able to add the dynamic date filter in the SQL query).

Kind regards
Maxim

4 REPLIES 4
amitchandak
Super User
Super User

what is the date filter you want ?

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

It should replace this:

 

FILTER (
        'F_DEPANNAGEANALYSE',
            DATE(YEAR(NOW());MONTH(NOW())-6; DAY(NOW())) <= F_DEPANNAGEANALYSE[DepannageUitgevoerdDatumtijd]
            && F_DEPANNAGEANALYSE[DepannageOproepDatumtijd] <= DATE(YEAR(NOW());MONTH(NOW()); DAY(NOW()))
    ),

You can see the slicer in my screenshot. (Top left)
But is has no effect on the calculated column.

Hi @Anonymous ,
 
Try to use ALLSELECTED instead of ALL.
 
Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

This is what i'm trying to achieve, calculated column:

Aantal = CALCULATE(
	COUNT(
		'F_DEPANNAGEANALYSE'[LiftID]
	);
	FILTER(
		ALLSELECTED('F_DEPANNAGEANALYSE');
		EARLIER(
			'F_DEPANNAGEANALYSE'[LiftID]
		) = 'F_DEPANNAGEANALYSE'[LiftID]
	)
)

When I use the code above, my total count is not working anymore. It counts all breakdowns (depannages - period: all time).
It SHOULD show the total of breakdowns / LiftID (elevatorID) for that time period.

(Current example: 5 instead of 33)
b1.pngb2.png

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors