Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
I need to convert this query in sql to power bi
select sum([lMoney) FROM Money
where (fromdate between '2017-09-02' and'2017-09-30') and (todate between '2017-09-08' and '2017-09-29' )
Is It possible ?
I have two columns to date ,from date I need to calculate monthly data (sum[money]) i.e Sept 2017 based on single date column but filtered on from date 2017-09-01 and to date 2017-09-30. How do i acheive that?
I don't understand much, but I hope this script helps. --> Query
First, you need to attach AdventureWorks DW. --> AdventureWorksDW
Then you can adapt to your case. (At the end, whenever you've created the view, use it in power bi)
Check out the CALCULATE() function in the DAX reference:
https://msdn.microsoft.com/en-us/library/ee634825.aspx
Essentially you would build something like this:
New Measure = CALCULATE(SUM([Money]), DATESBETWEEN([Fromdate],"2017-09-01","2017-09-30"), DATESBETWEEN([Todate],"2017-09-08", "2017-09-29"))
I need the sum of money for every month from firstdate - from date to lastdate (todate) of month.
for e.g Sept 1 to sept 30 but i need to select dates based on from date and to date column resp.
I need to have data from every month, so I need to generialize it
Easy to do, just update the filters in your calculate statement for your scenario. These filters don't have to be hard coded, in fact I almost always calculate these. How would you do this in your original T-SQL statement? DAX can likely emulate your approach.
For example, check out the DAX filter functions like ALLSELECTED():
https://msdn.microsoft.com/en-us/library/ee634807.aspx
Please can you help me with the code that what should I replace with in place of dates.
I am unable to do it
Your original TSQL statement doesn't give me enough details to help here, the example is using hard coded dates. DAX can certainly help you determine these dates, but you'll need to provide additional details.
I am unable to do it.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
56 | |
55 | |
54 | |
37 | |
29 |
User | Count |
---|---|
77 | |
62 | |
45 | |
40 | |
40 |