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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
reiskleiton
Helper II
Helper II

Measure returning wrong value after filter

Hi Power Bi Community, 

I am having a problem to create a measure in the right way.

I need to create a measure that return the Week Percentual from Accumulated and Today Volume percentual from Accumulated.
Well, I have created three measures that return that Accumulated, Week Accumulated, and Today Accumulated.

Accumulated = SUMX('MSForms Pivot', 'MSForms Pivot'[Volume])
 
Week =
CALCULATE (
    SUM ('MSForms Pivot'[Volume]),
    FILTER ( 'MSForms Pivot',
        WEEKNUM ([DataColeta]) = WEEKNUM (TODAY())
    )
)+0
 
Today =
CALCULATE (
    SUM ('MSForms Pivot'[Volume]),
    FILTER ('MSForms Pivot',
        'MSForms Pivot'[DataColeta] = TODAY())) + 0
 
Then, I created a new measure that return the percentage of Week and Today from Accumulated.
 
Week Percentage = CALCULATE(DIVIDE([Week], [Accumulated]))

When there is no filter applied to the dashboard, it gives the right result, but when a company is filtered, it gives me the wrong Week Percentage result for this company.

For example:
 
The Percentage of this week is 28.8 from the Accumalated (1336 * 100 / 4636).
reiskleiton_0-1702167984554.png
 
But if I select a company 1, it does not return the value from Percentage Week.
reiskleiton_1-1702168042203.png
 
CompanyWeekAccumulativePercentage WeekPercetage from Total
167597550.5221.03
239769729.7215.03
3753755.618.09
4453453.377.44
5353352.627.23
6333332.477.18
7283282.107.08
8253251.877.01
9233231.726.97
1003000.006.47
1103000.006.47
Total13364636100.00100.00

 

 

3 REPLIES 3
Ashish_Mathur
Super User
Super User

Hi,

Follow this process

  1. Create a Calendar Table with calculated column formulas for Year, Month name, Month number and week number.  Sort the Month name column by the month number
  2. Create a relationship (Many to One and Single) from the Date column of MSForms Pivot Table to the Date column of the Calendar Table
  3. Write/simplify these measres
Accumulated = SUM('MSForms Pivot'[Volume])
Today's week = weeknum(today())
Week = CALCULATE([Accumulated],FILTER (Calendar,Calendar[Weeknum] = [Today's week]))

Hope this helps.

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hi Ashish,

 

Thank you for you help.

I've tried what told me to do, but it doesn't work. Still getting the same result as before.


Hi,

Share the download link of the PBI file.  Show the problem and expected result very clearly.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

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.