cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

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
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors