March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hi, I am fairly new to Power BI.
I am using a dataset (Power BI dataset) as the source for my new report. I am trying to create a new measure using data calculations. Essentially, I have a column [Partner Deal Created Date] with date values: yyyy-mm-dd
I would like to add a measure column next to it with the previous month value (integer). Example ideal output:
Partner Deal Created Date | previousMonth |
2021-07-30 | 6 |
2021-06-30 | 5 |
2021-05-30 | 4 |
However whenever I try to perform a PREVIOUSMONTH (or just about any Date calculation for a measure), I get the following error when I add the measure to a table.
Formula:
Is this a limitation of using a Power BI dataset as the source or can this be achieved using a different formula?
My end goal is the be able to have a Measure as part of a slicer (which does not seem possible - I cannot add measures to slicers).
Thanks in advance!
Hi @Anonymous ,
Could you please share me with your pbix file after removing sensitive data?
Best Regards,
Eyelyn Qin
Hi @Anonymous ,
Based on my test
1. Connect to a Power BI dateset, and create [previousmonth] measure.
2. Create visuals on Power BI Desktop and publish the report to service. Both work fine on my side.
Did you create visuals firstly in Desktop? Is your Power BI Desktop the latest version?
3. It's not supported to apply measures to slicer.
4. When connect to a Power BI dateset , the connection mode is Live connection, we could not create calculated columns in this mode.
Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @v-eqin-msft ,
Thanks for writing! I succeeded to create the measure. However, I still get the error when trying to add it to a new visual (table) or existing table (visual). So unfortunately, I cannot even view the measured data (to confirm it is valid or not).
I created this in Power BI Desktop Version: 2.99.621.0 64-bit (November 2021) - I think the latest.
I am new to Power BI. I am using Live Dataset. What would the the negative impact if not Live Dataset?
Any thoughts on what this error means?
Thanks!
@Anonymous , if the date column is detected as date the
new column
month(eomonth([Partner Deal Created Date],-1) )
@Anonymous , Hope you are creating a new column, not measure. A column should not stop the selection of a column
I am creating measures. The option to create new columns or add tables are not there. I think this is because I am using a power bi dataset as my source.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
25 | |
18 | |
15 | |
9 | |
8 |
User | Count |
---|---|
37 | |
32 | |
18 | |
16 | |
13 |