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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
rachk
Helper I
Helper I

Count Values multiplied by a measure

Hi

I have tried mutiple ways of making this work. I have fields that are dates, so month and day they departed, month and day they arrived which is then calculated into number of days. I have then calculated how many people (Count of ID) on this date travelled. What I am attempting (and failing to do) is calculate the number of days by the Count of ID to end up with a total number of days travelled. The below is the snap of what is currently there. 

 

rachk_0-1749775726234.png

The last one I tried:

TotalImpact=

{COUNTROWS (ourformname)* Max (ourformname [Number of Days]}

Would LOVE any guidance on this one. 

 

 

1 ACCEPTED SOLUTION

Hi @rachk ,

Try to check with this:

Total Days Travelled =
SUMX (
SUMMARIZE (
TravelData,
TravelData[DepartureDate],
TravelData[ReturnDate],
"PeopleCount", COUNTROWS(TravelData),
"TripDays", MAX(TravelData[Number of Days]) 
),
[PeopleCount] * [TripDays]
)
Also please go through the updated pbix file.
If this post was helpful, please give us Kudos and consider marking Accept as solution to assist other members in finding it more easily.
Best Regards, 
Menaka. 
Community Support Team  

View solution in original post

34 REPLIES 34

I havent, I havent been around. I am trying to get the pbix someone asked for but dont even know how to do that to remove the identifable info. I have some data in excel but that doesnt show the number of days calculating the way it does - feel a bit over my head here. 

Hi   @rachk ,

Once you try to figure out how to mask sensitive data, Please share the data with us we will try to look into the issue.
Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
Do not include sensitive information. Do not include anything that is unrelated to the issue or question.
Please show the expected outcome based on the sample data you provided.
How to provide sample data in the Power BI Forum - Microsoft Fabric Community

Best Regards, 
Menaka. 
Community Support Team.

Hi

Departure date ends up displayed with month and day as does return date. 

ID is per person - this on my table shows as Count of ID

Number of days if derived between the dates of Departure date and return date. 

I am seeking the total number of days travelled per line eg on 5th June, there were 4 people who travelled 1 night so the last column I need to add should read 5. ID will come up on my screen as 5 as it identifies 5 people travelled on that date for 1 night each. 

 

DepartureDateReturnDateIDNumber of Days
25/05/2025 4:45:00 PM28/05/2025 7:40:00 PM83
14/04/2025 6:00:00 AM14/04/2025 4:00:00 PM91
14/04/2025 6:30:00 AM14/04/2025 5:00:00 PM101
8/04/2025 7:00:00 AM8/04/2025 3:00:00 PM111
8/04/2025 7:00:00 AM8/04/2025 2:30:00 PM121
20/06/2025 1:00:00 PM21/06/2025 11:00:00 AM131
16/03/2025 5:00:00 PM20/03/2025 8:00:00 PM144
25/05/2025 4:00:00 PM28/05/2025 8:00:00 PM153
1/05/2025 6:30:00 AM2/05/2025 10:00:00 AM181
28/05/2025 12:00:00 PM30/05/2025 1:00:00 PM212
20/06/2025 6:30:00 AM20/06/2025 7:30:00 PM221
15/05/2025 10:00:00 AM17/05/2025 2:00:00 PM232
5/06/2025 1:25:00 PM6/06/2025 7:00:00 AM241
5/06/2025 11:00:00 AM9/06/2025 2:00:00 PM254
5/06/2025 8:00:00 AM9/06/2025 12:00:00 AM263
5/06/2025 9:00:00 AM6/06/2025 5:00:00 PM281
5/06/2025 10:20:00 AM6/06/2025 4:20:00 PM291
5/06/2025 1:25:00 PM6/06/2025 1:00:00 PM301
14/05/2025 5:45:00 AM14/05/2025 8:30:00 PM311
14/05/2025 12:00:00 AM14/05/2025 12:00:00 AM321
5/06/2025 10:20:00 AM6/06/2025 11:55:00 AM331
18/05/2025 2:19:00 PM24/05/2025 7:13:00 AM345
15/05/2025 10:00:00 AM17/05/2025 2:00:00 PM352
27/05/2025 7:00:00 AM28/05/2025 8:00:00 PM361
19/06/2025 1:25:00 PM20/06/2025 7:40:00 PM371

Hi  @rachk  ,

Can you try this measure once and check.

Total Days Travelled =

SUMX (

    SUMMARIZE (

        TravelData,

        TravelData[DepartureDate],

        TravelData[ReturnDate],

        "@People", COUNT(TravelData[ID]),

        "@Days",   AVERAGE(TravelData[Number of Days])

    ),

    [@People] * [@Days]

)
Please go through the pbix file.

If this post was helpful, please give us Kudos and consider marking Accept as solution to assist other members in finding it more easily.
Best Regards, 
Menaka. 
Community Support Team  

I think that is getting closer. The ID moved into A1 etc but we have it counting each person who travelled so it needs to count. Number of days is already a measure based on the difference between the dates. 

I dont know how you got the @People part, it makes an error when I enter it, even following the above. 

Also, the total days travelled would work, IF we could get the ID to calculate if there is more than 1 person on that particular date. 

Hi @rachk ,

Try to check with this:

Total Days Travelled =
SUMX (
SUMMARIZE (
TravelData,
TravelData[DepartureDate],
TravelData[ReturnDate],
"PeopleCount", COUNTROWS(TravelData),
"TripDays", MAX(TravelData[Number of Days]) 
),
[PeopleCount] * [TripDays]
)
Also please go through the updated pbix file.
If this post was helpful, please give us Kudos and consider marking Accept as solution to assist other members in finding it more easily.
Best Regards, 
Menaka. 
Community Support Team  

OK, we have lift off! I have it working but its viewed with .00 at the end...yes I am still way over my head so apologise for this. At this point if it stays here then thats ok but if I can get it to a whole number, that would be great!

 

rachk_0-1751606148494.png

 

 

Hi @rachk ,

We really appreciate your efforts and for letting us know the update on the issue.
It can be done by changing the values decimal places to 0. Please go through the below screenshot.

vmenakakota_1-1751612586275.png

I hope this helps to resolve your query.

Thank you.

 

 

Hi @rachk ,

May I ask if you have resolved this issue? If you still have any questions or need more support, please feel free to let us know. We are more than happy to continue to help you. 
 

Thank you,

Community Member.

 

Hi @rachk ,

May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster. 

 

Thank you. 

Hi  ,
Thanks for reaching out to the Microsoft fabric community forum.
 
Can you check with this measure once:

TotalPersonDaysGrouped =
SUMX (
    ADDCOLUMNS (
        SUMMARIZE (
            TravelData,
            TravelData[DepartureDate],
            TravelData[ReturnDate]
        ),
        "Days", MAXX (
            FILTER (
                TravelData,
                TravelData[DepartureDate] = EARLIER(TravelData[DepartureDate]) &&
                TravelData[ReturnDate] = EARLIER(TravelData[ReturnDate])
            ),
            TravelData[Number of Days]
        ),
        "PersonCount", CALCULATE (
            COUNTROWS (TravelData)
        )
    ),
    [Days] * [PersonCount]
)

If I misunderstand your needs or you still have problems on it, please feel free to let us know.   

Best Regards, 
Hammad. 
Community Support Team  

The "days" are already a calculation so doesnt pick it up

 

rachk_0-1750034160154.png

 

Hi  @rachk  ,
Thanks for reaching out to the Microsoft fabric community forum.
 
Can you check with this measure once:

TotalPersonDaysGrouped =
SUMX (
    ADDCOLUMNS (
        SUMMARIZE (
            TravelData,
            TravelData[DepartureDate],
            TravelData[ReturnDate]
        ),
        "Days", MAXX (
            FILTER (
                TravelData,
                TravelData[DepartureDate] = EARLIER(TravelData[DepartureDate]) &&
                TravelData[ReturnDate] = EARLIER(TravelData[ReturnDate])
            ),
            TravelData[Number of Days]
        ),
        "PersonCount", CALCULATE (
            COUNTROWS (TravelData)
        )
    ),
    [Days] * [PersonCount]
)

If I misunderstand your needs or you still have problems on it, please feel free to let us know.   

Best Regards, 
Hammad. 
Community Support Team  

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 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.