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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
veron1990
Regular Visitor

Total of measure

Hello All,

 

I am begginer with Power Bi and i have the problem with Total for Measure. I need obtain sum of Measure2. I spent several hours on searching the answer and using several solutions from forum and youtube, but I didn't find the answer for my "sum".

Please find below link to my sample report.

MyReport

 

Thank you in advance.

4 REPLIES 4
Phil_Seamark
Employee
Employee

Hi @veron1990

 

This calculated measure gets pretty close.  I have attached my copy of the PBIX File.

 

Measure6 = 
    IF(
        ISFILTERED('Sheet1'[kraj]),
        --If not a total line then --
        [measure2],
        -- This is the calculation for the total line
        SUMX(
            ALLSELECTED('Sheet1'[kraj]),
            [measure2])
            )

image.png


To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

Hello Phil,

 

Thank you for your answer. Unfortunately your measure is working only for first level ("kraj"). if you go one level below, you have the same value. I need the measure that will be working for all hierarchy levels and filters.

Can you please give an example of what you would like the total line to show when drilling takes place.


To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

When i drilling the hierarchy I would like to have total line for chosen level. It means:

1. For first level (kraj) your formula is working. It should be approximately -0.8.

2. For second level (miasto) it should be sum of measure2 for this level (~-1.45):

secondlevel.PNG

3. For last level it should be the sum of measure2 for third level (the same value as for level2 because of small number of data, but in "real" project it will be different value). 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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