Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
I have a client who is looking to calculate Gross Revenue for a given month and prior month on the same report. I have used a measure to calculate Gross Revenue and for the prior period I've used the DATEADD, see below. Since the Fiscal Period is different then the calendar period they do not like the Fiscal Date to show 3/1/2019 but would like to change the format or have end user to select a period 2019-03 and automatically calculate the prior period 2019-02 on the same report without Date Function. Since the end user might be confussed and look at the fiscal date and think its March 2019. The Fiscal Period starts Nov. I've reached out to a few other and they don't recommend that I not use the time intelligence built in Power BI. I'm looking for alternative ways to calculate Gross Margin based on another field and then go back another period to show on the same report without using the date function? Any help or direction would be very appreciated. 🙂
Curent Priod | Prior Period | Variance | |
Gross Revenue | $ 254,005 | $ 215,989 | $ 38,016 |
Selling Margin $ | $ 128,485 | $ 118,285 | $ 10,200 |
Selling Margin % | 50.6% | 54.8% | -4.2% |
Hi @BobiRussell ,
It seems that you want to calculate the Last Fiscal Period Revenue, you could have a reference of this similar thread firstly.
Try the formula below.
Previous month Revenue = VAR currentFYYear = 'Date'[FYYear] VAR currentFiscalMonth = 'Date'[Fiscal Month] RETURN CALCULATE ( SUM ( 'Registrations'[Revenue] ), FILTER ( ALL ( 'Date' ), 'Date'[Fiscal Month] = currentFiscalMonth-1 && 'Date'[FYYear] = currentFYYear ) )
If you still need help, please share some data sample so that we can understand your scenario better and have test on it.
Best Regards,
Cherry
Hi Cherry,
Thank you for the DAX Code. Unfortunately, the DAX Code you provided didn’t work because I didn’t give you with table and column names to reference. I have a transaction file name "facts_transactionaltraverse" that columns that I’m using are;
Fiscal Date = CONCATENATE( facts_TransactionalTraverse[FiscalMonth],
CONCATENATE ("/" ,
CONCATENATE ("1" ,
CONCATENATE ("/" ,
facts_TransactionalTraverse[FiscalYear] ))))
I tried to modify the code you provided but I’m not getting it. I know that I should use the columns in the Date for periods but I was asked to reference the Fiscal Year & Month since their invoice dates don’t always correspond to Fiscal Period. Hope this info is more useful. Maybe I need to create another table?
Previous Month Revenue =
VAR currentFYYear = facts_TransactionalTraverse[FiscalYear]
VAR currentFiscalMonth = facts_TransactionalTraverse[FiscalMonth]
RETURN
CALCULATE (
SUM ( [Gross Revenue]),
FILTER (
ALL ( facts_TransactionalTraverse[Current Period] ),
facts_TransactionalTraverse[FiscalMon] = currentFiscalMonth-1
&& facts_TransactionalTravese[InvoiceDate]
= currentFYYear
)
)
Thank you again,
Bobi
Hi @BobiRussell ,
Have you solved your problem?
If you have solved, please always accept the replies making sense as solution to your question so that people who may have the same question can get the solution directly.
If you still need help, please share your data sample and your desired output so that we could help further on it.
Best Regards,
Cherry
Hi @BobiRussell ,
If it is convenient, could you share your data sample with table format and your desired output so that I could have a test on it and understand your requirement more clearly.
Best Regards,
Cherry
User | Count |
---|---|
127 | |
108 | |
99 | |
63 | |
62 |
User | Count |
---|---|
136 | |
113 | |
102 | |
71 | |
60 |