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
sbg94
Employee
Employee

Adding Custom Total column in Matrix Visual

 

Hi All,
I have been trying to create a matrix with some data. I want to show data with respect to year and month.
I want to show the Total sum Infront of percentage row in the total column.
Please find below image. 3rd row. Total_Auto Match Per.

sbg94_0-1604906334163.png

 


I am able to achieve this by using Dax but only if I Select Date range for more than one month.

If I select One month range like  1st-Aug- to 31st Aug then in the Aug-20 Month column and Total column both are showing same values.
But I want month column shows percentage and total column show total sum,

sbg94_1-1604906334166.png

 



Dax Formula
Total Value=CALCULATE(COUNT('Fact'[id]) )+0

Total_Auto Match =CALCULATE(COUNT('Fact'[id]),'Fact'[isauto] =1)+0 

Total_Auto Match Per=

var totalRequests =CALCULATE(COUNT('Fact' [id]),ALLSELECTED('Fact'))

//Precentage calculation

var Automatch=Divide( Total_Auto Match ,Total Value)

  return

    IF([Total Value]>=totalRequests  ,[Total_Auto Match]       ,Automatch)


How should I go about it. Any help is appreciated.
Thanks

 

2 REPLIES 2
Icey
Community Support
Community Support

Hi @sbg94 ,

 

It is needed to change the calculation logic of "Total_Auto Match Per" measure.

Total_Auto Match Per=

var totalRequests =CALCULATE(COUNT('Fact' [id]),ALLSELECTED('Fact'))

var Automatch=Divide( Total_Auto Match ,Total Value)

  return

    IF([Total Value]>=totalRequests  ,[Total_Auto Match]       ,Automatch)

 

 

 

Best Regards,

Icey

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@sbg94 , Not able to get your issue. Can you explain with example ?

 

Also for your % measure use % , 2 decimal from measure tool

Create it like
var Automatch= Divide( Total_Auto Match ,Total Value)

return

IF([Total Value]>=totalRequests ,[Total_Auto Match] ,Automatch)

Data Format New Rib.png

 

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.