Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
I have a measure that gives the sales over the given date in column B. I am trying to create another measure that would give me a results as in Column C (screenshot below).
Data Model:
The measure I have tried, but did not worked as expected.
Solved! Go to Solution.
Hi,
You may download my PBI file from here.
Hope this helps.
Hi,
You may download my PBI file from here.
Hope this helps.
=
CALCULATE (
LASTNONBLANKVALUE ( DimDate[DateKey], [Sales_Measure] ),
DimDate[DateKey] < MAX ( DimDate[DateKey] )
)
Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! |
DAX is simple, but NOT EASY! |
@PBI_enthusiast2 Try:
PD Measure =
VAR __DateKey = MAX('DimDate'[DateKey])
VAR __PDKey = MAXX(FILTER(ALL('DimDate'),[DateKey] < __DateKey)
VAR __Result = CALCULATE([Sales Measure], 'DimDate'[DateKey] = __PDKey)
RETURN
__Result
Hi @Greg_Deckler and @CNENFRNL. Could you share the way to solve this with the new WINDOW() and INDEX() functions.
Thank you.
No comments as I haven't mastered these newly introduced functions. I'm personally no fan for these funcs because they (seem to) sabotage the conciseness and elegance of "old-school" DAX funcs; IMHO they seem to be some replica of Tableau table calculation funcs.
Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! |
DAX is simple, but NOT EASY! |
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
84 | |
76 | |
73 | |
42 | |
36 |
User | Count |
---|---|
109 | |
56 | |
52 | |
48 | |
43 |