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
MatteoColzani
Frequent Visitor

Calculated Column does not filter Time

Hi,

 

I am creating a financial report based on a tabular cube and I am having a problem trying to extract the last Rate of a specific Instrument before the user selected period (<= Period).

I have the following tables:

 

 - RatingAssignment : this fact tables contains the link between the Instrument (SyId) and the Rate (RatingId) for all the days

Capture.PNG

- FactInstrument: it contains the Return values for each Instrument

- Instrument: dimension table of the instrument

 

 

What I need  to create is a bar chat with the Return values by Rating Capture.PNG

In order to get the correct Rates for the selected period, I built the following Calculated Column in the Instrument Table

 

=CALCULATE(
     VALUES(RatingAssignment [RatingId]);
     TOPN(1;
       CALCULATETABLE( 
          FILTER(RatingAssignment;RatingAssignment[RatingId]<>Blank());
          FILTER(ALL (TIME[Date] );TIME[Date]<=MAX(TIME[Date]))
         );
       RatingAssignment [Date];DESC)
     )

 

 

The Calculated column retrieves the Rating but does not consider the User Selected Period.

Anyone could you help me to understand how to filter this calculated column for the specific period?

 

Thanks you very much for your help!

1 ACCEPTED SOLUTION
v-chuncz-msft
Community Support
Community Support

@MatteoColzani,

 

Values in a calculated column are fixed. They are an immutable result for each row in the table. You'll need to create a measure.

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
v-chuncz-msft
Community Support
Community Support

@MatteoColzani,

 

Values in a calculated column are fixed. They are an immutable result for each row in the table. You'll need to create a measure.

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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