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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
patriciahogendo
Frequent Visitor

Need to create a measure for month and/or week and/or day

I want to create a measure which shows the salary per selected month(s) and/or week(s) and/or day(s). My datasheet shows only the salary per person per month.
This measure works for both month and week - I can select multiple months and/or weeks and the result is as expected using this formula:
 
IF
( ISFILTERED ( 'YearMonth Table'[YearMonth]),
IF(
ISFILTERED ( 'Billing Report'[Trigger Week] ),
SUM('Salary 2019'[Salary] ) * DISTINCTCOUNT( 'Billing Report'[Trigger Week] ) / 4,
SUM('Salary 2019'[Salary])
)
)
 
But I also want to add the option to filter on day. But when I add this to the one above, it doesn't work at all anymore.
I created a different formula showing all possible options and it works for a selected day or week, but not for the month anymore:
 
IF
(AND
(AND
(ISFILTERED('Billing Report'[Trigger Month]),
ISFILTERED('Billing Report'[Trigger Week])),
ISFILTERED('Billing Report'[TriggerDateTime])),
DISTINCTCOUNT('Billing Report'[TriggerDateTime] ) * SUM( 'Salary 2019'[Salary] ) / 21 ,
IF
(AND
(ISFILTERED('Billing Report'[Trigger Month]),
ISFILTERED('Billing Report'[TriggerDateTime].[Date])),
DISTINCTCOUNT( 'Billing Report'[TriggerDateTime] ) * SUM( 'Salary 2019'[Salary] ) / 21,
IF
(AND
(ISFILTERED('Billing Report'[Trigger Month]),
ISFILTERED('Billing Report'[Trigger Week])),
DISTINCTCOUNT( 'Billing Report'[Trigger Week] ) * SUM( 'Salary 2019'[Salary] ) / 4 ,
IF
(ISFILTERED('Billing Report'[Trigger Month]),
DISTINCTCOUNT('Billing Report'[Trigger Month]) * SUM( 'Salary 2019'[Salary] ),
IF
(ISFILTERED('Billing Report'[Trigger Week]),
DISTINCTCOUNT( 'Billing Report'[Trigger Week] ) * SUM( 'Salary 2019'[Salary] ) / 4,
IF
(ISFILTERED('Billing Report'[TriggerDateTime]),
DISTINCTCOUNT( 'Billing Report'[TriggerDateTime] ) * SUM( 'Salary 2019'[Salary] ) / 21,
"Shouldn't be possible" )
 
) ) ) ) )
 
Can anybody tell me what I am doing wrong here? Thanks a lot in advance!!
1 ACCEPTED SOLUTION

Thanks! Issue has been solved.

View solution in original post

3 REPLIES 3
Stachu
Community Champion
Community Champion

Can you add sample tables (in format that can be copied to PowerBI) from your model with anonymised data? Like this (just copy and paste into the post window).

Column1Column2
A1
B2.5

 



Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

Hi,

Thanks for your reply! As my dataset is quit big, I don't know how to do this.

Could you contact me via Skype (patricia.hogendoorn@damco.com ) so I can show you the whole dataset/dashboard?

Thanks a lot in advance! Patricia

 

Thanks! Issue has been solved.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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.