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
Annemie19
Helper II
Helper II

DAX Measures - data into columns based on DATES

Hi There, I have the data as shown below. I need to write a measure in PowerBI that will look at the REPORT FROM date. Then it needs to put the AMOUNT in the correct columns according to the REDEMPTION DATE. Thus, if the REDEMPTION DATE falls within the 1 Month, 1-3 Month, etc. bracket it will put the AMOUNT into that column as shown below. In Excel I used If statements, I'm just not sure how to do it in PowerBI.

 

Annemie19_0-1598341087694.png

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Annemie19 , Create measures like

 

1 month =
var _max = maxx(allselected(Date),date[Date])
switch( true(),
datediff(max(Table[redemption Date]),_max,Month) <=1, max(Table[Amount]), blank())


1 -3 month =
var _max = maxx(allselected(Date),date[Date])
var _dif =datediff(max(Table[redemption Date]),_max,Month)
switch( true(),
_dif >1 && _dif <=3, max(Table[Amount]), blank())

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

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@Annemie19 , Create measures like

 

1 month =
var _max = maxx(allselected(Date),date[Date])
switch( true(),
datediff(max(Table[redemption Date]),_max,Month) <=1, max(Table[Amount]), blank())


1 -3 month =
var _max = maxx(allselected(Date),date[Date])
var _dif =datediff(max(Table[redemption Date]),_max,Month)
switch( true(),
_dif >1 && _dif <=3, max(Table[Amount]), blank())

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

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.