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

Help on DAX

Hi,

 

Can someone help me on DAX please ? I am trying get sales data for last 12 month (Rolling 12). I am tring to create a calculated column and as output I want when the PO is in rolling 12 months it will show only rolling 12 months sales data but when it is false it will show all the sales data in my model

 

Last12 =
IF (
'F_SALES_LINES'[PO_Date] <= EOMONTH ( NOW (), -12 )
|| 'F_SALES_LINES'[PO_Date] >= EOMONTH ( NOW (), 0 ),
FALSE(),
TRUE()
)
 
Outcome expected:
True = True
False = True + False
 
Thanking in advance !
 
3 REPLIES 3
Greg_Deckler
Community Champion
Community Champion

I think that you are close except I would do this:

 

Last12 =
IF (
'F_SALES_LINES'[PO_Date] > EOMONTH ( NOW (), -13 )
TRUE(),
FALSE()
)
 
If this does not solve your problem, then there is not enough information presented. Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

The most important parts are:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2.


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

Great Thanks Greg,

 

How about when the condition does not meet and out come is False however when I filter in the report view I want to show the data as

True = When condition is True data

False = When condition is False (True + False togther will represent False)

 

Any idea how I can get this please ?

Sorry @Anonymous , didn't follow that.


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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