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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Kumarcy
Helper II
Helper II

Dax help

H Power Users,

 

I need help with a DAX calculation. I have 2 table and have relationship. I have Type column in table 1 and Amount column in Table 2. 

 

Below is the example data.

 

Input
TypeAmount
A100
B200
C300
D400
Total1000

 

 

Output 
TypeAmountTotal
A1001000
B2001000
C3001000
\D4001000
Total10001000

Total is the measure of Sum(Amount)

 

Thanks

1 ACCEPTED SOLUTION
Greg_Deckler
Super User
Super User

@Kumarcy  - So maybe:

 

Total Column = SUMX(ALL('Table2'),[Amount])

@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Mastering Power BI 2nd Edition

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

5 REPLIES 5
Greg_Deckler
Super User
Super User

@Kumarcy  - So maybe:

 

Total Column = SUMX(ALL('Table2'),[Amount])

@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Mastering Power BI 2nd Edition

DAX is easy, CALCULATE makes DAX hard...

@Greg_Deckler Thank you. It worked really well. I would like calculate % Total based on the measure created. 

 

%Total= Amount/ Total

 

Out put: 

 

Output   
TypeAmountTotal% Total
A100100010%
B200100020%
C300100030%
\D400100040%
Total10001000

100 %

 

Thanks,

 

@Kumarcy - That should just be:

Total % = [Amount] / [Total]

@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Mastering Power BI 2nd Edition

DAX is easy, CALCULATE makes DAX hard...

@Greg_Deckler Thanks for reply. I have a blank value in type and has amount to that. I would like to include the amount in total measure but should not show in the visual and i have a visual filter like id not equal to 1.  How can i acheive this?

camargos88
Community Champion
Community Champion

Hi @Kumarcy ,

 

Try this measure:

 
Measure = CALCULATE(SUM('Table'[Amount]), ALL('Table'[Type]))


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!



Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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