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
Anonymous
Not applicable

Multiply Daily Value by Monthly Value

I have 2 tables, 1 has monthly data and one has daily data.

 

I want to multiply my daily value by my monthly value in a measure so I can later splice the sum of cost per month

 

Sample Data:

 

Monthly Data 
DateRate
1/1/20182
2/1/20183
3/1/20184

 

 

Daily Data  (Desired output)
DateAmountCost
1/1/20181020
1/2/20181122
1/3/20181224
1/4/20181122
2/1/20181030
2/2/20181133
2/3/20181133
2/4/20181030
3/1/20181040
3/2/20181040
3/3/20181144
3/4/20181248
1 ACCEPTED SOLUTION

Hi,

 

You may refer to my solution in this PBI file.

 

Hope this helps.

 

Untitled.png


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

View solution in original post

6 REPLIES 6
Anonymous
Not applicable

Try this:

 

[Cost] =
SUMX (
    DailyTable,
    DailyTable[Amount] * LOOKUPVALUE (
            MonthlyTable[Rate],
            MonthlyTable[Date], DailyTable[Date]
        )
)
Anonymous
Not applicable

Thanks for your reply! 

 

Unfortunately this measure returns [first day of the month] * [monthly rate ] ; not a sum of the cost each day per month

@Anonymous

 

Try this MEASURE

 

CostMeasure =
CALCULATE (
    SUM ( MonthlyTable[Rate] ),
    FILTER (
        MonthlyTable,
        MONTH ( SELECTEDVALUE ( DailyTable[Date] ) ) = MONTH ( MonthlyTable[Date] )
    )
)
    * SUM ( DailyTable[Amount] )

Regards
Zubair

Please try my custom visuals

@Anonymous

 

See the attached pbix file

 

mdv.png


Regards
Zubair

Please try my custom visuals
Anonymous
Not applicable

Thank you for the reply @Zubair_Muhammad,

 

this works, but it does not work for when the tables are connected to a common date table unfortunately. Sorry for the misunderstanding.

 

See pbix file not sure how to upload pbix file,

 

I have a custom table 

 

Calendar =
CALENDAR ("2012-1-1" , "2021-01-01")

 

with both tables linked to it. Any ideas?

 

Hi,

 

You may refer to my solution in this PBI file.

 

Hope this helps.

 

Untitled.png


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

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.