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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
DrewSmith
Helper III
Helper III

Calculated field in custom table not working

Hi, 

I'm trying to build a visual in PowerBI that is essentially a matrix with 14 different calculations from different tables into one. 
I've managed to set up an example as below and it's pulling through the correct total figure, however when I filter for month (There is another Calendar table) the count does not change. There is a relationship that works between the Sales table and Calendar on the Use_SaleDate to Calendar[Date] (neither have time in the date field). Any idea why it's not working. It should go from 12,943 to 3,561 if the sale was in 2023 for example. 

 

Todays.jpg

4 REPLIES 4
mlsx4
Memorable Member
Memorable Member

Hi @DrewSmith 

Maybe you should include a CALCULATE in the formula:

Something similar to this:

CALCULATE (count (Sales[Use_SaleDate]),USERELATIONSHIP([date], calendar[date]))

Thank you @mlsx4 , when added, it doesn't error but doesn't alter the figures.
I've checked and their is a relationship set up and it now reads: 

AW_Matrix_Table =
{
(2, "CS","Sales","",calculate(count(Sales[Use_SalesDate]),USERELATIONSHIP(Sales[Use_SalesDate],'calendar'[Date])))
}

Okey, then you may take the selectedvalue from the slicer?

AW_Matrix_Table =
{
(2"CS","Sales","",calculate(count(Sales[Use_SalesDate]),SELECTEDVALUE(calendar[date])))
}

I've tried that but it errors: The True/False expression does not specify a column. Each True/False expressions used as a table filter expression must refer to exactly one column.

So I have 14 different calculations, coming from about 10 different tables. All use a different date for example, Sale date, return date, cancellation date, so I thought creating that relationship between tables to a calendar table and using that for the slicer, and the matrix table to populate and calculate the data would be the easiest option, but it's proving far from it. 

An example of the returns calculation would be: 

AW_Matrix_Table =
{
(2"CS","Sales","",calculate(count(Sales[Use_SalesDate]),SELECTEDVALUE(calendar[date]))),
(3, "CS","Returns","",calculate(count(Return[Use_ReturnDate]),SELECTEDVALUE(calendar[date])))
}

I could use a stack of card visuals but it's not as nice a view in my opinion. 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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.