Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
yasbos
Resolver I
Resolver I

Unable to remove the row filter using ALL

Hi. My goal is to calculate the total requests in the current month for each department as a percentage of the total requests in the current month. 
 
 
Please, help 🙂 Thanks so much.


 
5 REPLIES 5
Ahmedx
Super User
Super User

to get the latest sales date write like this
var vMaxDate=LASTNONBLANK(Service[Created_Time],[_Total_Requests]) ---- [_Total_Requests] is the amount of sales

or
var vMaxDate=LASTNONBLANK(Service[Created_Time],[Amount]) ----  [Amount] is the amount of sales

Ashish_Mathur
Super User
Super User

Hi,

Share the download link of the PBI file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

@Ashish_Mathur  it's a large file with many tables and measures. I was just hoping that, knowing the above facts/details, that someone could point me in the right direction. Btw, I have been trying to use datesmtd on the dates column in the calendar dimention table, which is related to the service table using a date column. It doesn't work because, for some reason, datesmtd returns the full list of dates of the last month in the calendar dimension table--that's December of 2023. If I use datesmtd on the date column in the service fact table, I get an error stating that that column has duplicate values--well, it is expected to have duplicate values; it's a FACT table.

amitchandak
Super User
Super User

@yasbos , for MTD , YTD month etc use date table and time intellignece

 

exmaple

 

MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD('Date'[Date]))

this month = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(ENDOFMONTH('Date'[Date])))
last MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(dateadd('Date'[Date],-1,MONTH)))
last month Sales = CALCULATE(SUM(Sales[Sales Amount]),previousmonth('Date'[Date]))
MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD('Date'[Date]))
last MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(dateadd('Date'[Date],-1,MONTH)))
last month Sales = CALCULATE(SUM(Sales[Sales Amount]),previousmonth('Date'[Date]))
next month Sales = CALCULATE(SUM(Sales[Sales Amount]),nextmonth('Date'[Date]))

Time Intelligence, Part of learn Power BI https://youtu.be/cN8AO3_vmlY?t=27510
Time Intelligence, DATESMTD, DATESQTD, DATESYTD, Week On Week, Week Till Date, Custom Period on Period,
Custom Period till date: https://youtu.be/aU2aKbnHuWs&t=145s

@amitchandak  datesmtd causes the code to return an empty set because it seems to return the dates of the last month in my calendar table, instead of the dates from the 1st to the 23rd of March. My calendar table has dates to the end of the year--to December 31, 2023. Datesmtd returns december 1 to 31 2023. If I use the date field from my fact table instead, I then get an error that the date column contains duplicate values! Well, obviously the date column in my fact table will contain multiples of the same date, since there are multiple requests made on the same date 🙂

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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