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
Anonymous
Not applicable

Create DAX table with % calculation

Hello,

 

I need your support with the next issue please.

I have the next 2 tables.

I want to create a 3rd table, calculating for every Audit type, the % of the number of companies in column (company) in table B from the total number of companies identified as 'Important' in table A.

 

Is it possible to create a new column with this calculation automatically once per month ? (target is to avoid to overwrite the existing one, but for example to create new column with the updated % every end of month - to keep history).

 

pbi2.JPG

 

 

Thanks for your support.

Best regards.

1 ACCEPTED SOLUTION
FrankAT
Community Champion
Community Champion

Hi @Anonymous ,

what about the following solution:

 

26-05-_2020_01-02-48.jpg

 

 Regards FrankAT

View solution in original post

6 REPLIES 6
FrankAT
Community Champion
Community Champion

Hi @Anonymous ,

what about the following solution:

 

26-05-_2020_01-02-48.jpg

 

 Regards FrankAT

Anonymous
Not applicable

Thanks it works perfectly !

 

Greg_Deckler
Super User
Super User

@Anonymous I believe you want something like:

Table C = 
ADDCOLUMNS(
  ADDCOLUMNS(
    SUMMARIZE(
      'Table B',
      [Audit type],
      "Number of companies",COUNTROWS(DISTINCT('Table B'[Company]))
    ),
    "Important company in",COUNTROWS(ALL('Table A'),[Classification]="Important")
  ),
  "%",[Number of companies] / [Important company in]
)

@ 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!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

Hello,

 

Thanks for the solution it is working (after a small correction in line 8 - missing 'FILTER').

missing.JPG

 

BR.

amitchandak
Super User
Super User

@Anonymous , calculation of no of companies and important in companies creating doubt, can you explain with example

Anonymous
Not applicable

Hello,

 

Thanks for your interest.

I succeeded to create the table with the team support 😉

I still don't have an answer for the second part of my question:

 

Is it possible to save the calculated "%" in a new table (to take a fixed image of these value), every specified frequency (every end of month for example) ? 

 

BR.

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.