Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
I've tried various DAX expressions and Variables, but I can't find a solution that considers counting without the blank.
I don't just want to place a segmented selection but I want it to be displayed on the card.
Card displayed
I need
Previous month data that should appear on the card (in this case JUNE):
Pbix file:
https://1drv.ms/u/s!Avq1zGJizBimsUCECKbCmKD7UL7g?e=yZmBqc
Thanks for all.
Regards,
Denis.
Solved! Go to Solution.
@deniselias
Here you go https://www.dropbox.com/t/h3DOOlrfoIp3orlY
MIRO count LastMonth 2 =
VAR SelectedDate = TODAY ( )
VAR StartOfPreviousMonth = EOMONTH ( SelectedDate, - 2 ) + 1
VAR EndOfPreviousMonth = EOMONTH ( StartOfPreviousMonth, 0 )
VAR Result =
CALCULATE (
COUNT ( 'P Manual'[MIRO date] ),
'P Manual'[MIRO date] >= StartOfPreviousMonth,
'P Manual'[MIRO date] <= EndOfPreviousMonth,
'P Manual'[Status] = "6.1 PAYMENT RELEASED",
REMOVEFILTERS ( 'P Manual' )
)
RETURN
Result
Hi,
You may download my PBI file from here.
Hope this helps.
Hello @Ashish_Mathur ,
Thanks for this answer, it also gave me a new perspective.
Thank you so much for sharing the expertise.
Regards,
Denis.
You are welcome. If my reply helped, please mark it as Answer.
Hi @deniselias
I'm not sure if I correctly undesrand your requirement. However please refer to the sample file with the proposed solution https://www.dropbox.com/t/WWioOOfNgkr5JlrI
Actually this measure calculates the number of records in the previous month up to the day of today. For example today is 17th so if you select June the measure will return the count from May 1st up to May 17th. If nothing is selected it will return the same but for the month before the last month that has record in your data. In this case the last data available is for November. So it will return the count for October (by the way your data does not have records for August, September or October but strangely it has for November). However, this can be changed if you wish to refer to the current day instead for example.
Please let me know my assumptions are correct or something else that has to be done. Thank you
MIRO count LastMonth 2 =
VAR SelectedDate = MAX ( 'P Manual'[MIRO date] )
VAR StartOfPreviousMonth = EOMONTH ( SelectedDate, - 2 ) + 1
VAR EndOfPeriod = DATE ( YEAR ( StartOfPreviousMonth ), MONTH ( StartOfPreviousMonth ), DAY ( TODAY() ) )
VAR Result =
CALCULATE (
COUNT ( 'P Manual'[MIRO date] ),
'P Manual'[MIRO date] >= StartOfPreviousMonth,
'P Manual'[MIRO date] <= EndOfPeriod,
'P Manual'[Status] = "6.1 PAYMENT RELEASED",
REMOVEFILTERS ( 'P Manual' )
)
RETURN
Result
Hello @tamerj1 ,
Thanks for reply, but it wasn't exactly what I needed. What I wanted is for the card to display the exact amount of postings (MIRO date count) from the previous month. Without me having to select the month.
Because it shows blank, I wanted it to show the count of 5523.
Thanks for the help ultil now.
@deniselias
Here you go https://www.dropbox.com/t/h3DOOlrfoIp3orlY
MIRO count LastMonth 2 =
VAR SelectedDate = TODAY ( )
VAR StartOfPreviousMonth = EOMONTH ( SelectedDate, - 2 ) + 1
VAR EndOfPreviousMonth = EOMONTH ( StartOfPreviousMonth, 0 )
VAR Result =
CALCULATE (
COUNT ( 'P Manual'[MIRO date] ),
'P Manual'[MIRO date] >= StartOfPreviousMonth,
'P Manual'[MIRO date] <= EndOfPreviousMonth,
'P Manual'[Status] = "6.1 PAYMENT RELEASED",
REMOVEFILTERS ( 'P Manual' )
)
RETURN
Result
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
96 | |
69 | |
44 | |
38 | |
29 |
User | Count |
---|---|
154 | |
93 | |
63 | |
42 | |
41 |