March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hello everyone,
I'm trying to SUM a column called "Offline Time". This column has 300 rows. But I don't want to SUM all these rows, I want to SUM using data segmentation as a parameter.
For example, I select 1 week, in data segmentation, this means that I need to SUM only seven rows in "Offline Time" and not all 300 rows.
Thanks in advance.
Hi:
In your date table, please mark column date as Date Table. Then add calc columns to date table.
WEEK No. = WEEKNUM(DateTableName[Date])
YEAR = YEAR(DateTableName[Date])
Month No. = MONTH(DateTableName[Date])
Connect your date table date filed to your facttable date column, to create a relationship.
Stay with original measure Total = SUM(Table[offlinetime])
Add slicer taking week no field from date table. picture below.
Use slicer to get the the values you want for sum of offlinetime.
Hello,
thanks for your tip.
However, I can not use the week as a slicer. I need to use the complete date. And the full date is not working as well. 😕
Hi:
That doesn't make too much sense to me as I can't see your model. Can you supply this file for a more complete answer?
Thanks
Of course not. This file is for my organization. lol
I'm not studying. I'm working.
Hi:
If you have a column for week no. in your fact table and you have built your slicer off of that, your measure should work dynamically.
The measure would be something like Total = SUM(TableName[Offline Time)
It will give you the correct answer if your column next to Offline Time has week no.
Here is calculated column for week no:
Week No = WEEKNUM(TableName[Date Field])
If this doesn't work can you post some more info about your question? (The model, what the table has for columns, relationships,..)
Thanks
Thanks for the answer 😉
But I believe that the key is to sum the column with some condition.
I'm trying something like that:
Hi:
If I can see the data (some data with exepcted result) I can try to answer more thoruoghly.
The way yo have your data model and the visual you are attempting to create pretty much drives the DAX solution.
Thanks!
Table Offline Calendar:
Offline table:
Data Segmentation using Offline Calendar:
Now I need to sum these three offline time rows (Tempo Offline(min))
Thanks in advance 🙂
Hi @Anonymous ,
Do you create relationship between your two tables? If you have created it, no other action is needed. The measure result will change dynamically based on your date slicer, which called "visual interactions".
For more details about relationship, please check:
Model relationships in Power BI Desktop - Power BI | Microsoft Docs
Create and manage relationships in Power BI Desktop - Power BI | Microsoft Docs
For more details about visual interactions, please check:
Slicers in Power BI - Power BI | Microsoft Docs
Change how visuals interact in a report - Power BI | Microsoft Docs
Understand how visuals interact in a report - Power BI | Microsoft Docs
Filters and highlighting in Power BI reports - Power BI | Microsoft Docs
Best Regards,
Icey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hello,
after your tip, I did the relationship between these two tables. But it does not help at all.
Hi @Anonymous ,
Could you create a sample file with the same issue for test? You can simplify your model with some dummy data.
Reference: How to provide sample data in the Power BI Forum - Microsoft Power BI Community
Best Regards,
Icey
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
23 | |
15 | |
12 | |
9 | |
8 |
User | Count |
---|---|
41 | |
32 | |
29 | |
12 | |
12 |