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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Samand
Frequent Visitor

Summary table utilizing dynamic dates from slicer

I've got 4 tables:

1. dim_Dates - Dax table with dates from the minimum date in fact_AcqDisp to today().

2. fact_AcqDisp - from SharePoint and pre-prepared through Power Query. One row per building.

3. fact_Building - from SharePoint and preprepared in PowerQuery. Contains building details. One row per building.

4. fact_Measurements - from SharePoint and preprepared in PowerQuery. Contains measurements. Multiple rows per building.


Tables 2 - 4 are linked through a matching Ref_ID


I've put the dates from table 1 into a "between" slicer.

 

Tables 2 & 4 both have FROM and TO date fields. 


I need to create a summary table, based on grouping from a column (Building_Type) in table 3, which calculates the number of linked rows in Table 2 & 3, where tables 2 & 3 are filtered by dates from the slicer. It also needs to sum the measurements from Table 4 based on the slicer dates.

 

Does anybody have any suggestions on how to do this?

1 ACCEPTED SOLUTION

Hi @Anonymous 

 

I've solved this by creating a DAX table using GENERATESERIES() to generate 10 rows representing the last 10 years. I cross-joined this table with one of my existing tables and added calculated columns derived from other tables. This gives me a row of data for each building for each year, allowing me to filter by year. Since there are only a couple of hundred buildings, it works well, but I might need to limit the number of years for performance reasons.

View solution in original post

9 REPLIES 9
Anonymous
Not applicable

Thank you Sahir_Maharaj 

Hi, @Samand 

In import mode, after the data is imported into a Power BI model, you can't dynamically generate a calculated table based on the slicer. You'll need to change the connection mode to direct query and then do this with the parameters in Power Query.

Dynamic M query parameters in Power BI Desktop - Power BI | Microsoft Learn

vjianpengmsft_0-1733194598808.png

 

 

Best Regards

Jianpeng Li

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

 

Hi Jianpeng Li,

 

Thanks for your response. I don't think that  you can change a SharePoint list to Direct Query and it's the only source I can use.

Anonymous
Not applicable

Hi, @Samand 

Thank you very much for your reply!

Thank you for your question. The slicer you mentioned really doesn't affect the calculated table, it only works when the slicer is working. At the same time, it's true that the SharePoint list you're using can't be converted to Direct Query mode.

Currently, slicer-based dynamic table generation is only possible in Power BI with Direct Query mate parameters. This is a current limitation and we understand that this may cause some inconvenience.

If you have additional needs or need further assistance, please feel free to let us know. We will do our best to provide you with support and solutions.

 

Best Regards

Jianpeng Li

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

Hi @Anonymous 

 

Thanks again. So there is no available solution to what I would like to achieve.

Anonymous
Not applicable

Hi, @Samand 

Thank you for your reply.  If you want to do this, you can still do things like read your SharePoint into a database, and then Power BI connects to those databases to do what you want. Or you just need to create some measures that use summarize to create some virtual tables, and then reflect the corresponding results in the visuals.

 

Best Regards

Jianpeng Li

Hi @Anonymous 

 

I've solved this by creating a DAX table using GENERATESERIES() to generate 10 rows representing the last 10 years. I cross-joined this table with one of my existing tables and added calculated columns derived from other tables. This gives me a row of data for each building for each year, allowing me to filter by year. Since there are only a couple of hundred buildings, it works well, but I might need to limit the number of years for performance reasons.

Anonymous
Not applicable

Hi, @Samand 

Ok. If you're experiencing performance issues, you can try the built-in performance monitoring tools in Power BI desktop:

vjianpengmsft_0-1733722350713.png

Or you can use DAX studio to see the overall performance. If the performance penalty is not significant, then you can maintain your current practices. If the performance is slow, you need to generate the number of years as you say now.

I think if you only need this table, you can do it by entering the table without having to calculate the table generation, which will greatly improve the report performance.

 

 

Best Regards

Jianpeng Li

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

Sahir_Maharaj
Super User
Super User

Hello @Samand,

 

Can you please try this consolidated DAX for a calculated table:

SummaryTable = 
SUMMARIZE(
    'fact_Building',
    'fact_Building'[Building_Type],
    "Total Rows AcqDisp", 
        CALCULATE(
            COUNTROWS('fact_AcqDisp'),
            'fact_AcqDisp'[FROM] <= MAX('dim_Dates'[Date]) &&
            'fact_AcqDisp'[TO] >= MIN('dim_Dates'[Date])
        ),
    "Total Rows Building", 
        CALCULATE(
            COUNTROWS('fact_Building'),
            'fact_AcqDisp'[FROM] <= MAX('dim_Dates'[Date]) &&
            'fact_AcqDisp'[TO] >= MIN('dim_Dates'[Date])
        ),
    "Total Measurements", 
        CALCULATE(
            SUM('fact_Measurements'[Measurement_Value]),
            'fact_Measurements'[FROM] <= MAX('dim_Dates'[Date]) &&
            'fact_Measurements'[TO] >= MIN('dim_Dates'[Date])
        )
)

Did I answer your question? Mark my post as a solution, this will help others!

If my response(s) assisted you in any way, don't forget to drop me a "Kudos" 🙂

Kind Regards,
Sahir Maharaj
Data Scientist | Data Engineer | Data Analyst | AI Engineer
P.S. Want me to build your Power BI solution? (Yes, its FREE!)
➤ Lets connect on LinkedIn: Join my network of 15K+ professionals
➤ Join my free newsletter: Data Driven: From 0 to 100
➤ Website: https://sahirmaharaj.com
➤ Email: sahir@sahirmaharaj.com
➤ Want me to build your Power BI solution? Lets chat about how I can assist!
➤ Join my Medium community of 30K readers! Sharing my knowledge about data science and artificial intelligence
➤ Explore my latest project (350K+ views): Wordlit.net
➤ 100+ FREE Power BI Themes: Download Now
LinkedIn Top Voice in Artificial Intelligence, Data Science and Machine Learning

Hi Sahir_Maharaj


Thanks for your response.

 

This doesn't work. I Think it's because DAX tables don't recalculate based on slicers. When referencing dim_Dates it uses all of the dates. I think only measures recalculate based on slicer selections.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors