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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
mmace1
Impactful Individual
Impactful Individual

Dimension tables from SUMMARIZECOLUMNS, that update based on Calendar Table Data selection?

I have a dataset that is 1 year of data. The dataset is just from an SQL query I wrote. 

 

From that dataset, I've created Dimensions using SUMMARIZECOLUMNS.  Here's an example of the Cust_MiD_DIM dimension:

Cust_MiD_DIM = 
SUMMARIZECOLUMNS (
    Invoices[MiD],
    Invoices[CustomerNumber],
    "Cust_MiD_SpendPerMonth", DIVIDE ( SUM ( Invoices[PaidAmount] ), [MonthsOfData] ),
    "Cust_MiD_InvoicesPerMonth", DIVIDE ( COUNT ( Invoices[PaymentID] ), [MonthsOfData] ),
    "Cust_MiD_PmtsPerMonth", DIVIDE ( DISTINCTCOUNT ( Invoices[PaymentID] ), [MonthsOfData] ),
    "Cust_MiD_DaysSinceLastPmt", DATEDIFF ( MAX ( Invoices[CreateDateUTC] ), [MostRecentPmt], DAY ),
    "Cust_MiD_DaysSince1stPmt", DATEDIFF (MIN (Invoices[CreateDateUTC] ), [MostRecentPmt],DAY)
)

 

 

 

So great, I can each of the columns from the above dimension into a filter, that the user can use to filter the report. And if we change the underly dataset date range, everything still calculates correctly. 


But, the user would like to be able to filter the dataset by date, and then have that date range affect the dimensions. 


e.g. -

 

Say  MiD A and CustomerNumber 1 average 10 invoices a month between 6/1/2019 and 6/1/2020.  If the user decides to limit to 1/1/2019 - 6/1/2020 on the calendar filter, they want that Cust_MiD_DIM dimension table to update, so that it reflects the # of invoices per month in that new date range (which maybe is something other than 10). 

I'm a little stumpted how to do that. Is it even possible?  Doesn't SummarizeColumns only update on data refresh, so that this approach 100% can't work for that additional request? 

 

Is there another way? 



1 ACCEPTED SOLUTION

Hi @mmace1 ,

 

Has your problem been solved?

You try to use the [MiD] column to create a relationship between the two tables. Although the data of the calculated table is derived from the fact table, they can not interact if there is no active relationship between the two tables.

nnn7.PNG

 

Best regards,
Lionel Chen

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

5 REPLIES 5
mmace1
Impactful Individual
Impactful Individual

 @amitchandak Thanks!   I (think) I'm familar with the concepts you linked, but I don't think they apply to this situation, do they? 

 

 

@mmace1 ,Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

mmace1
Impactful Individual
Impactful Individual

FactTable.PNG

Example Fact Table

 

ExampleDimension.PNG

Example Dimension Table, that's built off of the above fact table (same dimension as I shared the code for in the first post)

What the user (theoretically) wants to do, is to be able to change that dimesion, say where it says Cust_MiD_SpendPerMonth, and instead of it being based on the full set of data in the Fact table, to have it based on a date range that they select within the report.  Do I make sense? 

Hi @mmace1 ,

 

Has your problem been solved?

You try to use the [MiD] column to create a relationship between the two tables. Although the data of the calculated table is derived from the fact table, they can not interact if there is no active relationship between the two tables.

nnn7.PNG

 

Best regards,
Lionel Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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