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
Bunta
Frequent Visitor

Cumlative and non cumulative measure

 

 Hi all,

I have a question over design of a measure table and another around the measures that sit within it in Power BI.

 

  1. The data I receive comes in a long skinny file similar to figure 1. However the measures cannot, with the example being SFLU1 and SFLU12, be summed as their construction is different. Am I right to pivot the data to make each measure a column to stop this like in figure 2

In the example I have put together I have two different styles of measures from the same collection.

Scenario 1: Measure 1 is put into a table without the achievement_date column. This is fine as Measure 1 can be summed over time

Scenario 2: Measure 12 is put in a table WITH the achievement_date column. This is fine as measure 12 is a point in time measure

Scenario 3: Measure 12 is put in a table WITHOUT the achievement_date column. This can’t happen as Measure 12 cannot be summed over time due to double counting

 

  1. Can I create one measure table for the above scenarios above or do I need one table for measure 1 and one for measure 12 or can a calculated measure be used to solve the issue?
CODEACHIEVEMENT_DATEMEASUREVALUE
130/09/2015SFLU001247
131/10/2015SFLU0011128
130/09/2015SFLU01261
131/10/2015SFLU012270
230/09/2015SFLU001128
231/10/2015SFLU0011168
230/09/2015SFLU01254
231/10/2015SFLU012245

Fig 1

 

CODEACHIEVEMENT_DATESFLU001SFLU012
130/09/201524761
131/10/20151128270
230/09/201512854
231/10/20151168245

Fig 2

 

Thanks

5 REPLIES 5
v-huizhn-msft
Employee
Employee

Hi @Bunta,

>>The issue I'm trying to get to the bottom of now, is that of the measures in the file some of them can be summed up over time whilst some can't. For example measure 1 is ok to sum over time as it only counts people the first time in the first month they appear no matter how times they appear. Measure 12 though counts people in the month meaning that that they can appear in every month and so summing the measure will lead to double counting.

 

Based on your description, I am still confused your issue. And how to count people for Measure1 and Measure12, could you please share more datails and use number in table to list your requriement?  So I can help you directly.

Thanks,
Angelia


Hi Angela,

 

Thanks very much for taking the time to reply. I have edited the post and hope it is easier to understand now. I don't know if Power BI can do it one table or not.

 

Thanks

 Hi @Bunta,

Yeah, Power BI can do it. I test it using your given sample data.(named 'Test1').

1.PNG

Then click New Table under Modeling on home page, type the DAX statement, you will get expected result, then right click the CODE column header->Sort Ascending(highlighted in red line), please review the screenshot below.

Table 3 = SUMMARIZE(Test1,Test1[CODE],Test1[ACHIEVEMENT_DATE],"SFLU001",CALCULATE(SUM(Test1[Value]),FILTER(Test1,Test1[MEASURE]="SFLU001")),"SFLU012",CALCULATE(SUM(Test1[Value]),FILTER(Test1,Test1[MEASURE]="SFLU012")))

2.PNG


If you have other issues, don't hesitate to let me know.

Best Regards,
Angelia

Hi Angelia,

 

Thanks for the response. Sorry for the late reply but I've been away until today. I've input your solution and it pivots the data which solves one problem, however it still allows the measure SFLU012 to summed up when no achievement_date has been specified. I.E. if I create a table with just code and SFLU012 it sums up SFLU012 which is what can't happen.

 

I've created a calculated measure below and I assume there is no way round apart from specifing a measure that requires a achievement date to be specified by using a filter.

 

SFLU012_CALC = if(VALUES('Table 3'[ACHIEVEMENT_DATE]) = BLANK(), BLANK(), (sum('Table 3'[SFLU012])))

Is this the only way round to use something like the above in the code you provided?

 

thanks

Hi @Bunta,

Do you still list the achievement date in result table? Please try a calculated column using your the if formula.

 

if(VALUES('Table 3'[ACHIEVEMENT_DATE]) = BLANK(), BLANK(), 'Table 3'[SFLU012])

 Then use formula above to create new table.

Best Regards,
Angelia

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.