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 in Power BI by anonymous
• 48,800 points
48 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 by Gitika
• 48,800 points

Related Questions In Power BI

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 22, 2019 in Power BI by VNK
15,753 views
0 votes
1 answer

What options do I have for viewing and working with data on premises

There are three ways to achieve the ...READ MORE

answered Oct 15, 2018 in Power BI by Hannah
• 18,410 points
67 views
0 votes
1 answer

list reports with calculated percentage in Power BI using dax

Create a Measure called Total Revenue: Total Revenue = SUMX( ...READ MORE

answered Oct 22, 2018 in Power BI by Hannah
• 18,410 points
384 views
0 votes
1 answer

How to calculate cumulative Total and % in DAX?

Hi, If your table is ready with percentage ...READ MORE

answered Mar 18, 2019 in Power BI by Cherukuri
• 32,490 points
9,820 views
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 in Power BI by Alisha
39 views
0 votes
1 answer
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 in Power BI by Gitika
• 48,800 points
219 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 in Power BI by Gitika
• 48,800 points
98 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 in Power BI by Gitika
• 48,800 points
30 views