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.
Hello,
I have only one table with these columns.
Last month column is a flag refers to the latest month in the fact table and it is generated in the sql query itself.
In the dashboard I want to calculate the values of the Previous month to last month which is for example 202304 .. and I don't want to add any time slicer, I want all to happen through measures, I also don't need a date column.
Any way I created a measure to get the Previous Month ID which is 202304 .. the measure is as follow
I found a solution for that but don't know if this is the optimum one or no, change the measure to
Previous Month Measure = CALCULATE(SELECTEDVALUE(Fact_Sales[Month_ID]),filter(ALL(Fact_Sales), Fact_Sales[Last Month]=1))-1
Hi, @john_elmasry
Yes. Your original formula is pretty close to the correct answer, but you need to add an ALL filter at the critical time.
ALL function (DAX) - DAX | Microsoft Learn
Or try this:
Previous Month Measure = CALCULATE(MAX(Fact_Sales[Month_ID]),filter(ALL(Fact_Sales), Fact_Sales[Last Month]=1))-1
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
49 | |
25 | |
20 | |
15 | |
12 |
User | Count |
---|---|
57 | |
49 | |
44 | |
19 | |
18 |