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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
July 2024 Power BI Update

Power BI Monthly Update - July 2024

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

July Newsletter

Fabric Community Update - July 2024

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

Top Solution Authors