Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hello I have a very simple issue,
Below is the data set,
I always need previous month count, like in current month. I need September data. PLease help.
You need to create a date table for this to work, then it is a very simple solution.
=CALCULATE( [Total Sales], PREVIOUSMONTH('Calendar'[Date]) )
That will calculate your sales for the previous month. edit: fixed an extra comma in my formula above. Now it works. 🙂
DAX is for Analysis. Power Query is for Data Modeling
Proud to be a Super User!
MCSA: BI ReportingThanks yes, I have a date table which connects with other data table
Here is my measure = TOTAL_SALES = SUMX(Filter('SALES_TABLE','SALES_TABLE'[COLOR]="Blue"),'SALES_TABLE'([Amt])
Measure 2 = CALCULATE ([TOTAL_SALES], PREVIOUSMONTH('DATE_Table'[Date_Key]))
But as you can see, it returens all the previous months, if I remove Year_Month column, it dows not show any data
Hi,
What is the problem with this output? What result are you expecting?
I just want to get one value SUM of Last Month, but it is returning sum of each month like 15 rows or so.
Not entirely clear on what you are looking for, but have you given OPENINGBALANCEMONTH or PARALLELPERIOD try?
@AnonymousI'm looking for very simple output only sum of last month's sales.
Let's see if this gets in the right direction:
@AnonymousThanks Nick, but how do I get on previous month sum not the running total. Like In OCT I only wnat to see Sep totals.
You don't need to have the "Total Sales" measure in the table. Removing that measure, and only having the Previous Month Sales, will show October on the row, but will have September's sales. Though that could lead to some confusion.
Another idea could be to use ParallelPeriod, which shows the grand total of the previous month, regardless if you are at a lower granularity
@Anonymouscan I send you my PBIX, it is very simple file with 2 tables
Sending the PBIX would have saved a lot of time from the start.
@Anonymous wrote:@Anonymouscan I send you my PBIX, it is very simple file with 2 tables
DAX is for Analysis. Power Query is for Data Modeling
Proud to be a Super User!
MCSA: BI ReportingI don't understand what you mean by "it returns all of the previous months." It should. It isn't cumulative. March will show Feb, Feb will show Jan, Jan will show Dec of previous year.
Show me exactly what the issue is, as you only showed "Measure 2" and not "Total Sales"
The first thing to check though is make sure any date data in your table is coming from the Date table, not the date field in your sales table. The date intelligence functions require the Calendar/Date table to be used in the visuals to work right.
DAX is for Analysis. Power Query is for Data Modeling
Proud to be a Super User!
MCSA: BI ReportingSo here is my fact table and date table, date keys in fact are coming from Date table.
Here is Total Sales
TOTAL_SALES = SUMX(Filter('SALES_TABLE','SALES_TABLE'[COLOR]="Blue"),'SALES_TABLE'([Amt])
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
99 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
102 | |
87 | |
64 |