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

How to calculate Divide correctly with filter

 I am new to Power BI  I will be very happy if members can help me get my head around this calculation, from the attached file I want to calculate The a Measure for  dividing the Sum(TotalPages) of a selected Company (aab)  on a given month eg January for a particular Country Using the Target for that CountryPbi File.PNG

 

ie TotalPages/Target = Calculate (Sum(TotalPages) / Target) with the following filters Table[Date]="January" Table[Country]="UK" [Target]="15,000".   Using excel the calculation is Sum(TotalPages)=1561 Target=15000 for country UK on January 1561/15000 = 10.41%. I want it to work if the filters are changed for other months, country and company as well

1 REPLY 1
PattemManohar
Community Champion
Community Champion

@Anonymous  Please try this as a New Measure

 

Test210 = 
VAR _TotalPages = SUM(Test210Measure[TotalPages])
VAR _Target = SUM(Test210Measure[Target])
RETURN FORMAT(_TotalPages/_Target,"Percent")

image.pngimage.png





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

Proud to be a PBI Community Champion




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.