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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Divide all dates values on a a specific date value from a norther column

Hi all 

I have the followeing table: 

Hadi2021_0-1637046760346.png

I would like to divide all returned values  from the 4th column on only the sales from January 

How could I achieve that ? 

Thanks in advance

Regards 

 

1 ACCEPTED SOLUTION
v-zhangti
Community Support
Community Support

Hi, @Anonymous 

 

If you try to solve it with calculated columns, it will be easy.

 

Sales_January =
CALCULATE (
    MAX ( 'Table'[Sales] ),
    FILTER (
        'Table',
        [Date].[MonthNo] = 1
            && [Date].[Year] = EARLIER ( 'Table'[Date].[Year] )
    )
)
%Returned/January = DIVIDE([Returned],[Sales_January])

 

vzhangti_0-1637306870371.png

 

Best Regards,

Community Support Team _Charlotte

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

6 REPLIES 6
v-zhangti
Community Support
Community Support

Hi, @Anonymous 

 

If you try to solve it with calculated columns, it will be easy.

 

Sales_January =
CALCULATE (
    MAX ( 'Table'[Sales] ),
    FILTER (
        'Table',
        [Date].[MonthNo] = 1
            && [Date].[Year] = EARLIER ( 'Table'[Date].[Year] )
    )
)
%Returned/January = DIVIDE([Returned],[Sales_January])

 

vzhangti_0-1637306870371.png

 

Best Regards,

Community Support Team _Charlotte

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

Anonymous
Not applicable

I need to divide all values on the red boxes on the value of the first month of the their year 

Hadi2021_1-1637052819022.png

When I apply divide (Returned, Sales January) it only divided the first month and don't divide the other months. 

In OTher words, sales January is a measure where it calculate the sales when month = "January" , now I want to fill down all the missing data . in the third column ('Slaes January') so I can divided on the 4th column to calculate the ratio 

amitchandak
Super User
Super User

@Anonymous ,

Either use an independent date slicer and select jan there
// Independent Date table - Date1 and Joined Table Date
measure =
var _max = maxx(allselected('Date1'),'Date1'[Date]) // Use Date(2021,01,31)
var _min = minx(allselected('Date1'),'Date1'[Date])
return
CALCULATE(SUM(Sales[Sales Amount]),filter(Date, Date[Date]>=_min && Date[Date] <=_max ))

 

or put date


measure =
var _max = Date(2021,01,31)
var _min = Date(2021,01,01)
return
CALCULATE(SUM(Sales[Sales Amount]),filter(Date, Date[Date]>=_min && Date[Date] <=_max ))

 

You can also Table's Date in place Date[Date]

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Thank you for the fast reply 

I think I misexplained my problem 

I want to divide all the months returned value on the sales resulted from first month of the year 

Hadi2021_0-1637048603324.png

The idea filling all the values in yellow so I can build monthly trend

Thanks again and looking forward for your help 

REgards 

@Anonymous , Use all in filter and try

 

measure =
var _max = Date(2021,01,31)
var _min = Date(2021,01,01)
return
CALCULATE(SUM(Sales[Sales Amount]),filter(all(Date) , Date[Date]>=_min && Date[Date] <=_max ))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Unfortunately its not working 

Hadi2021_0-1637052589106.png

I need to return the value of sales for the first month of the year. this value should be a reference value to divide all  other values on it 

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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