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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Anonymous
Not applicable

DAX measure

Hi,
Through an earlier query, I was helped to create a Derived table using 'matrix' visualization. apologies that I should have asked that I really needed exact help on - I am calculating % Progress as - (Status1+Status2)/Grand Total. I am not sure how to get the DAX for creating this % Progress column/measure. Can you help?

Base Table  Derived Table     
GroupsWork StatusWork Id Count of Work IdColumn Labels  Measure?
abcStatus11 Row LabelsStatus1Status2Status3Grand Total% Progress
abcStatus22 abc11 2100%
defStatus23 def 21367%
defStatus24 Grand Total131580%
defStatus35       
1 ACCEPTED SOLUTION

Hi @Anonymous ,

 

Kindly try my last DAX which I suggested.

 

Thanks,

Pragtai

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

View solution in original post

6 REPLIES 6
Anonymous
Not applicable

Hi,May be I was not clear. Let me explain

Base Table - left side     Derived Table-right side

GroupsWork StatusWork Id      Measure? 
abcStatus11 Groups(from Base Table)Status1(Per Groups count)Status2(Per Groups count)Status3(Per Groups count)Grand Total*% Progress 
abcStatus22 abc11 2100% 
defStatus23 def 21367% 
defStatus24 Grand Total131580% 
defStatus35        

Derived Table (Only available as Excel pivot and I can draw a matrix visual upto Grand Total*)

Grand Total* = Status 1 + Status2 + Status3 (based on Groups, you can observe)

I'm thinking of a DAX Measure which calculates (status1+staus2)/Grand Total* and grouped by Groups -just thinking on these lines, so that I can include '%Progress' as another column by the side of Grand Total*?

Thanks for all your support

Hi @Anonymous ,

 

Kindly try my last DAX which I suggested.

 

Thanks,

Pragtai

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

Anonymous
Not applicable

Thanks a lot Pragati, this works fine. Regards,

Pragati11
Super User
Super User

Hi @Anonymous ,

 

Is STATUS1, STATUS2 and GRAND TOTAL separate columns in your dataset or they are calculated measures?

If these are 3 measures, just create another measure as follows:

Progress% = DIVIDE(([Status1] + [Status2]), [Grand Total], 0)

The chnage the dattype of  Progress% to percentage.

 

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

Anonymous
Not applicable

Hi Pragati, But Status1 and Status2 are actually row values from my base table and grouped by Groups column. I sense the query has to include the reference to base table and have something like group by/filter by 'Groups' may be?

Hi @Anonymous ,

 

Therefore I asked you whether they are columns or not as you havenot mentioned any data structure in your query for your original dataset.

Also what does GRAND TOTAL represents? If I tale GRAND TOTAL as rows in the dataset, then you can write following measure:

Progress%=

var st1 = CALCULATE(COUNTROWS(tablename), tablename[WorkStatus] = "Status1")

var st2 = CALCULATE(COUNTROWS(tablename), tablename[WorkStatus] = "Status2")

var totRows = COUNTROWS(tablename)

RETURN
DIVIDE((st1 + st2), totRows, 0)

 

Replace "tablename" in above DAX with your table name.

 

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.