DAX Problem with subtotals and grand totals

0 votes

Basically what I need is to calculate the revenue per kilometer for each service in a period (year, month, day).

The calculation should be, basically:

Sum of [Price] (each ticket sold in the period) / Sum of [Km] (of the period considerating the services with their respective kilometers)

Can someone help me out with this?

Oct 5, 2020 in Power BI by anonymous
• 65,770 points
1,905 views

1 answer to this question.

0 votes

Create a new measure for the km traveled:

Total Km =
SUMX (
    SUMMARIZE (
        Data,
        Data[Track],
        Data[Date],
        Data[Time],
        "Total_km", DISTINCT ( Data[Kilometers Column] )
    ),
    [Total_km]
)
answered Oct 5, 2020 by Gitika
• 65,770 points

Related Questions In Power BI

0 votes
1 answer

DAX Power BI: Replaced blank values with zero and issue with chart

It seems like you're facing an issue ...READ MORE

answered Aug 22, 2023 in Power BI by anonymous
• 1,420 points
1,720 views
0 votes
1 answer

How do you write DAX expressions that work well with disconnected tables and slicers?

Certain techniques can be useful in writing ...READ MORE

answered Oct 29, 2024 in Power BI by pooja
• 12,450 points
193 views
0 votes
1 answer

What are some practical examples of how Power BI Copilot can assist with building DAX measures and queries?

Power BI Copilot can make building DAX ...READ MORE

answered Dec 27, 2024 in Power BI by pooja
• 12,450 points
77 views
0 votes
2 answers

Power BI Dax Multiple IF AND Statements

HI I have Column Patient 12 13 14 15 18 IN Patient=12, 13 Out ...READ MORE

answered May 23, 2019 in Power BI by VNK
19,098 views
0 votes
1 answer
0 votes
1 answer

How to get month name from month number in Power BI?

You can use: MonthName = FORMAT(DATE(1, [Num], 1), ...READ MORE

answered Sep 24, 2020 in Power BI by Alisha
6,422 views
0 votes
1 answer

How do I count rows in one table based on values in another table using DAX?

If the tables are related, this is ...READ MORE

answered Sep 24, 2020 in Power BI by Gitika
• 65,770 points
22,945 views
0 votes
1 answer

How to ignore a slicer for one measure, but apply it on another?

In order to ignore Slicer you need ...READ MORE

answered Oct 1, 2020 in Power BI by Gitika
• 65,770 points
7,139 views
0 votes
1 answer

DAX Calculate function with and without FILTER

You could make [Measure12] return the same results as ...READ MORE

answered Sep 24, 2020 in Power BI by Gitika
• 65,770 points
4,098 views
0 votes
1 answer

What is the difference between DAX and Power Query?

DAX stands for Data Analysis Expressions. DAX ...READ MORE

answered Sep 24, 2020 in Power BI by Gitika
• 65,770 points
13,610 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP