Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
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.
User | Count |
---|---|
47 | |
26 | |
21 | |
17 | |
15 |
User | Count |
---|---|
53 | |
34 | |
17 | |
17 | |
15 |