The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
I tried to write the following:
Solved! Go to Solution.
the issue is from the nature of variable in DAX. Once defined, a variable is stored as a constant. So whatever filter you add in expressions like
CALCULATE(CY, SAMEPERIODLASTYEAR('Calendar'[Date]))
it simply return CY, a constant defined before.
So CALCULATE([Total Sales], SAMEPERIODLASTYEAR('Calendar'[Date])) is the right approach.
Dear Sudden Clarity,
You could use same period last year as a Variable - see my example where as Variable is using same periodlastyear
and with date change,
the issue is from the nature of variable in DAX. Once defined, a variable is stored as a constant. So whatever filter you add in expressions like
CALCULATE(CY, SAMEPERIODLASTYEAR('Calendar'[Date]))
it simply return CY, a constant defined before.
So CALCULATE([Total Sales], SAMEPERIODLASTYEAR('Calendar'[Date])) is the right approach.
User | Count |
---|---|
16 | |
8 | |
7 | |
6 | |
6 |
User | Count |
---|---|
26 | |
13 | |
12 | |
8 | |
8 |