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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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