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
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
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.