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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.