The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
HI,
I have a query on a calculation where i want to find all expenses from a column A where the values are labelled "#Authorised" and where those string values with "#Authorised" resource are within the next 3 months from a date column within the table.
So far my calculation on creating the measure is like below
Solved! Go to Solution.
Hi,
Create a Calendar Table. Create a relationship from the Date column of your data table to the Date column of the Calendar Table. Write these measures
Sumexpenses = sum(Table[Expenses]
Measure for Authorsid = calculate([Sumexpense], Filter(Table, containsstring(Table[Resource], "#Authorised")
Measure calculate([measure for authorsid],datesbetween(calendar[date],today(),eomonth([today(),3)))
Hope this helps.
pls try this
Measure for Authorsid = calculate(Table[Sumexpense],
Filter(ALL(Table), containsstring(Table[Resource], "#Authorised"))
Authorised =
CALCULATE([#Authorised],
KEEPFILTERS(FILTER(ALL(Table),
[#Authorised]>=TODAY()&&[#Authorised]<= EOMONTH(TODAY(),3)))
)
Hi Ahmedx,
Thanks for your reply. However, this calculation is still giving me the total of all the values without filtering by date e.g it doesn't filter from Today till the end of March and give me the total for this duration. So, filtering doesn't take place anywhere. When i put this measure in the table visual along with the date column, it gives the same grand total amount for each individual date.
Regards,
Sam
Hi @samoberoi
Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-...
Please show the expected outcome based on the sample data you provided.
https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523
Hi Ritaf1983,
Date | Resource | Expenses |
24/03/2024 | #Authorised Milan | $280.33 |
15/02/2024 | #Unauthorised Utopia | $390 |
12/01/2024 | #Authorised Burma | $101.20 |
08/12/2022 | #Authorised Milan | $20.20 |
09/12/2023 | Pangong | $1000.80 |
18/12/2023 | #Comet | $550 |
01/01/2023 | #Authorised | $490.51 |
01/01/2024 | #Unauthorised Belgium | $280.33 |
e.g:-
Sumexpenses = calculate(sum(Table[Expenses])
Measure for Authorsid = calculate(Table[Sumexpense], Filter(Table, containsstring(Table[Resource], "#Authorised"
Now i would be interested in the calculating only the ones which have the string value #Authorised from Resource column and which are within the next 3 months from today within the table e.g it is 16/12/2023 today, it should calculate it from today till the end of March 2024 for which i tried to use following meaure, but doesn't seem to work.
Authorised = CALCULATE([#Authorised], FILTER(Table, [#Authorised]>=TODAY()&&[#Authorised]<= EOMONTH(TODAY(),3)))
Thanks
Hi,
Create a Calendar Table. Create a relationship from the Date column of your data table to the Date column of the Calendar Table. Write these measures
Sumexpenses = sum(Table[Expenses]
Measure for Authorsid = calculate([Sumexpense], Filter(Table, containsstring(Table[Resource], "#Authorised")
Measure calculate([measure for authorsid],datesbetween(calendar[date],today(),eomonth([today(),3)))
Hope this helps.
Hi Ashish,
Thanks for your response. I created the calendar table and tried to use your calculations, this calculation is still giving me the total of all the values without filtering by date e.g it doesn't filter from Today till the end of March and give me the total for this duration. So, filtering doesn't take place anywhere on this either.
Regards,
Sam
I can help further only when i get the file. Write my measures in that file and show the problem clearly. Share the download link of the file.
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the August 2024 Power BI update to learn about new features.
User | Count |
---|---|
123 | |
85 | |
77 | |
55 | |
49 |
User | Count |
---|---|
135 | |
127 | |
78 | |
64 | |
63 |