cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
NiMa
Frequent Visitor

Regarding Matrix Column Total Calculation based on date selection

Hi,

I have to create a DAX which calculates the total of a column based on date and then divide the row total of that with the total value.

eg. 

NiMa_0-1653462984500.png

So, i want to create a measure which take amount total value based on date and calculate amount(%) by dividing individual row by total amount in the same way as shown in table.

 

Kindly suggest.

1 ACCEPTED SOLUTION
NiMa
Frequent Visitor

Thank you Guys for the help..

I also tried using this :

 

Total = CALCULATE(Table[Amount],ALLEXCEPT(Table,Table[Date))

 

and it worked !!

 

Thanks for your help as well.

View solution in original post

3 REPLIES 3
NiMa
Frequent Visitor

Thank you Guys for the help..

I also tried using this :

 

Total = CALCULATE(Table[Amount],ALLEXCEPT(Table,Table[Date))

 

and it worked !!

 

Thanks for your help as well.

Samarth_18
Super User
Super User

Hi @NiMa ,

 

You could create a measure as below:-

Measure =
VAR total =
    CALCULATE (
        SUM ( 'Table (2)'[Amount] ),
        ALL ( 'Table (2)'[Variety] ),
        'Table (2)'[Date] = MAX ( 'Table (2)'[Date] )
    )
RETURN
    DIVIDE ( MAX ( 'Table (2)'[Amount] ), total )

Refer attached file.

 

BR,

Samarth

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

Anonymous
Not applicable

Hi

 

first measure , sales by day by variety==>

Total sales = sum(Fruit[Amount])
 
second measure , Total sales for the day==> 
Total sales day = calculate(sum(Fruit[Amount]),REMOVEFILTERS(Fruit[Variety]))
 
Third measure, calculate %
%sales = divide(Fruit[Total sales],Fruit[Total sales day],0)
JamesFr06_0-1653463792683.png

 

Helpful resources

Announcements
PBI Sept Update Carousel

Power BI September 2023 Update

Take a look at the September 2023 Power BI update to learn more.

Learn Live

Learn Live: Event Series

Join Microsoft Reactor and learn from developers.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

MPPC 2023 PBI Carousel

Power Platform Conference-Power BI and Fabric Sessions

Join us Oct 1 - 6 in Las Vegas for the Microsoft Power Platform Conference.

Top Solution Authors