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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
PBI5851
Helper V
Helper V

Help on Per Day and Month Calculation

Hello folks ,

 Please can you help me resolve the monthly count. The numbers are correct when i display the day, but if i remove the day, the monthly counts are incorrect. For the Data Model, the date on Calendar table is connected to Job_start

 

CntRepJob_StartJobID
23Steve10/1/2020J1234
15Mosaic10/1/2020J1235
19Perez10/1/2020J1236
14Mike10/1/2020J1237
4Greta10/1/2020J1238
21Mary10/1/2020J1239
20Kate10/1/2020J1240
20Jackie10/1/2020J1241
23Nancy10/1/2020J1242
18Angie10/1/2020J1243
20Steve10/2/2020J1244
19Mosaic10/2/2020J1245
1Perez10/2/2020J1246
14Diana10/2/2020J1247
10Mike10/2/2020J1248
1Greta10/2/2020J1249
19Mary10/2/2020J1250
22Kate10/2/2020J1251
18Jackie10/2/2020J1252
12Michele10/2/2020J1253
21Sam10/2/2020J1254
18Angie10/2/2020J1255
20Steve10/5/2020J1256
1Perez10/5/2020J1257
6Mike10/5/2020J1258
16Diana10/5/2020J1259
16Mike10/5/2020J1260
20Greta10/5/2020J1261
16Kate10/5/2020J1262
16Jackie10/5/2020J1263
3Evelyn10/5/2020J1264
12Michele10/5/2020J1265
13Nancy10/5/2020J1266
21Sam10/5/2020J1267
12Angie10/5/2020J1268
17Steve10/6/2020J1269
16Mosaic10/6/2020J1270
20Perez10/6/2020J1271
4Mike10/6/2020J1272
17Diana10/6/2020J1273
18Mary10/6/2020J1274
21Kate10/6/2020J1275
3Evelyn10/6/2020J1276
14Nancy10/6/2020J1277
21Sam10/6/2020J1278
19Mosaic10/7/2020J1279
18Perez10/7/2020J1280
16Diana10/7/2020J1281
13Mike10/7/2020J1282
17Greta10/7/2020J1283
17Mary10/7/2020J1284
21Jackie10/7/2020J1285
2Evelyn10/7/2020J1286
11Michele10/7/2020J1287
15Nancy10/7/2020J1288
20Sam10/7/2020J1289
11Angie10/7/2020J1290
18Steve10/8/2020J1291
19Mosaic10/8/2020J1292

 

The goal is to capture per day , how many reps were active and multiply it by a 5, but Steve, Kate and Angie get 8, 9 and 10 as the factor. 

 

Ex: on 10/1, there were 10 reps, so the target count for 10/1 should be 7*5 + (1*8  #for steve) + (1*9 #for kate) + (1*10 #for angie)

on 10/2 there were 12 reps, so the target count is 8*5 +  (1*8  #for steve) + (1*9 #for kate) + (1*10 #for angie) = 43

What I am trying to achieve is two visuals. 

Day Visual 

DateTarget Count
10/1/2062
10/2/2067
10/5/2072
10/6/2062
10/7/2082
10/8/2013

 

Monthly Visual

MonthTarget Count
Oct358

 

I'm able to achieve the Day breakdown, but when i try to display the month , i dont get the correct value. Please could you help me figure this out. 

 

 

10 REPLIES 10
CNENFRNL
Community Champion
Community Champion

Hi, @PBI5851 , I'd create a dimentional table for different factors respective to all rep as follows,

Screenshot 2020-10-14 105841.png

Here's the data model Screenshot 2020-10-14 105951.png

and the resultScreenshot 2020-10-14 110207.png

You might want to refer to the attached file for details.


Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

@CNENFRNL . The idea will work, but i dont think i can create a sub-table of drep, because the reps can change frequently and we can have new reps as its a moving list. Is there a way to populate the drep table dynamically.

@CNENFRNL I did try your solution too. But it doesnt work if there are multiple months. If its a single month, it works, but with multiple months, everything shows the same value. 

Ashish_Mathur
Super User
Super User

Hi,

You may download my PBI file from here.

Hope this helps.

Untitled.png


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

@Ashish_Mathur Thank you for the file. There is a mistake though. For May 10th, Mike shows up twice, but should be counted only once. so the count for May 10th will be 9 reps + steve + kate + angie i.e 45 +8+9+10 = 72. Any recommendation on how to fix that. 

Hi,

Edit the measure to

Measure = SUMX(SUMMARIZE(VALUES(Data[Rep]),[Rep],"ABCD",min(Data[Column])),[ABCD])

Hope this helps.


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

Hi @Ashish_Mathur . As per your recommendation (named as New Measure) , the individual values are correct, but the total is now incorrect.

 

PBI5851_0-1602689460034.png

 

Hi,

You may download my PBI file from here.

Hope this helps.

Untitled.png

 


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

@PBI5851 , You can create a measure like this and try

 

sumx(table, Switch(true(), [Rep] = "Steve" , 8 , [Rep] = "Kate" , [Rep] = "Angie" , 10 , 5))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
sevenhills
Super User
Super User

If it is me, I would have done like this....

 

a) Add calculated column in the transform data  

 #"Added Conditional Column" = Table.AddColumn(#"Changed Type", "Custom Goal", each if [Rep] = "Steve" then 8 else if [Rep] = "Kate" then 9 else if [Rep] = "Angie" then 10 else 5),

 

gives something like 

sevenhills_0-1602637247483.png

 

b) Dax Measure  

Active Goal Count = 
var tempTable1 = SUMMARIZE('Your Table', 'Your Table'[Rep], 'Your Table'[Custom Goal], 'Your Table'[Job_Start])

Return sumx(tempTable1, 'Your Table'[Custom Goal])

 

Output :

sevenhills_1-1602637345875.png

 

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors