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

Dividing daily data by monthly data

Hi guys,

 

I have 2 data sets 

Set A Period (Daily)Value
01/01/205
02/02/206
03/02/207
04/02/208
05/02/209
Set B period (Monthly)Value
01/01/20 - Jan70
01/02/20 - Feb50
01/03/20 - Mar60
01/04/20 - Apr50

 

I need the individual days division in which for Set A / Set B daily
01/01/20 - 5 / 70

02/01/20 - 6 / 70 
03/01/20 - 7 / 70


Now, I am just getting start of the month data because it is taking set B period 01/01/20 not as the month of janurary but for the literal date of 01/01/20 giving me the graph.

nicholaskong_0-1602823576683.png

 

I believe the main idea would to make 01/01/20 in the month data set B be repeated for everyday in the same month = 02/01/20 = 03/01/20 ... = 70 but i have no idea how to to do that 

 

 
 

 

 
 

 

 

 

 

1 ACCEPTED SOLUTION
v-janeyg-msft
Community Support
Community Support

Hi, @Anonymous 

 

It’s my pleasure to answer for you.

According to your description, I think you can create a measure to calculate your desired result.

Like this:

result =
VAR a =
    SELECTEDVALUE ( Table1[Value] )
VAR b =
    CALCULATE (
        SUM ( Table2[Value] ),
        FILTER (
            ALL ( Table2 ),
            FORMAT ( [Set B period (Monthly)], "mmm yyyy" )
                = FORMAT ( SELECTEDVALUE ( Table1[Set A Period (Daily)] ), "mmm yyyy" )
        )
    )
RETURN
    DIVIDE ( a, b )

v-janeyg-msft_1-1603112109808.png

If it doesn’t solve your problem, please feel free to ask me.

 

Best Regards

Janey Guo

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-janeyg-msft
Community Support
Community Support

Hi, @Anonymous 

 

It’s my pleasure to answer for you.

According to your description, I think you can create a measure to calculate your desired result.

Like this:

result =
VAR a =
    SELECTEDVALUE ( Table1[Value] )
VAR b =
    CALCULATE (
        SUM ( Table2[Value] ),
        FILTER (
            ALL ( Table2 ),
            FORMAT ( [Set B period (Monthly)], "mmm yyyy" )
                = FORMAT ( SELECTEDVALUE ( Table1[Set A Period (Daily)] ), "mmm yyyy" )
        )
    )
RETURN
    DIVIDE ( a, b )

v-janeyg-msft_1-1603112109808.png

If it doesn’t solve your problem, please feel free to ask me.

 

Best Regards

Janey Guo

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@Anonymous , Create a common date table and join both tables to date table date usinf date column  and then group the data at month level using month in date table

 

To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :radacad sqlbi My Video Series

 

divide(Sum(Table1[Daily(Value]) ,Sum(Table2[Monthly(Value]) )

 

Appreciate your Kudos.

 

Anonymous
Not applicable

Hi Amit, I dont really understand the part of grouping it by month.

nicholaskong_0-1602824521558.png

 

So far i've done this, by my data output gives me 

nicholaskong_1-1602824613217.png

@amitchandak 

 

 

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.