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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
alsm
Helper III
Helper III

CalculateTable is empty on visual but corresponding Calculate shows correct row count

If I write Calculate with filter, create a visual card and select date, it shows correct count

Num_SelectDetailsRows =
VAR select_date = SELECTEDVALUE(EomDates[Date])
VAR filt_headertbl = CALCULATETABLE(VALUES(HeaderTbl[HeaderKey]), FILTER(HeaderTbl, [ValidFrom] <= select_date && [ValidTo] >= select_date))
VAR filt_detailstbl = CALCULATE(COUNT(DetailsTbl[DetailsKey]), DetailsTbl[HeaderKey] in filt_headertbl)
RETURN
 filt_detailstbl
 
However, if i convert it into a table and show on visual it shows empty
Table =
VAR select_date = SELECTEDVALUE(EomDates[Date])
VAR filt_headertbl = CALCULATETABLE(VALUES(HeaderTbl[HeaderKey]), FILTER(HeaderTbl, [ValidFrom] <= select_date && [ValidTo] >= select_date))
VAR filt_detailstbl = CALCULATETABLE(DetailsTbl, DetailsTbl[HeaderKey] in filt_headertbl)
RETURN
 filt_detailstbl
 
Sample data is 
HeaderTabl
HeaderTbl
HeaderKeyValidFromValidTo
H11Jan202231Dec2022
H215Feb202231Oct2022
H310Mar202215Sep2022
H_FebOnly7Feb202225Feb2022
H_FebMar25Feb2022

14Apr2022

 

DetailsTbl
DetailsKeyHeaderKeyNameCurrency
D1H1AEUR
D2H2BGBP
D3H3CAUD
D4H_FebOnlyDGBP
D5H_FebMarEUSD

 

Dates I try in slicer

Date

31 Dec 2021
31 Jan 2022
28 Feb 2022
31 Mar 2022
30 Apr 2022
31 May 2022
30 Jun 2022
31 Jul 2022
31 Aug 2022
30 Sep 2022
31 Oct 2022
30 Nov 2022

 

What am I missing?

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@alsm , A calculated table, can not take the slicer values. that is why the table is empty

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@alsm , A calculated table, can not take the slicer values. that is why the table is empty

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors