Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now
Hi,
I using below DAX:
Thanks,
Sandip
Solved! Go to Solution.
@dsandip OK, it's incorrect but what is your definition of correct? Maybe this?
Current Quarter Sales =
VAR __Current = MAX( 'Calendar'[Current QTD] )
VAR __Result = IF( __Current = 1, CALCULATE([Sales Amount], FILTER(ALL('Calendar'), 'Calendar'[Current QTD] = 1)), 0 )
RETURN
__Result
@dsandip You should be able to do this:
Cureent Quarter Sales = CALCULATE([Sales Amount], 'Calendar'[Current QTD] = 1)
or:
Current Quarter Sales =
VAR __Current = MAX( 'Calendar'[Current QTD] )
VAR __Result = IF( __Current = 1, [Sales Amount], 0 )
RETURN
__Result
Hi,
Your first and 2nd Measure DAX is showing below result which is incorrect:
@dsandip OK, it's incorrect but what is your definition of correct? Maybe this?
Current Quarter Sales =
VAR __Current = MAX( 'Calendar'[Current QTD] )
VAR __Result = IF( __Current = 1, CALCULATE([Sales Amount], FILTER(ALL('Calendar'), 'Calendar'[Current QTD] = 1)), 0 )
RETURN
__Result
Yes, it is working now. But I wonder that why it is not working for below DAX:
So, we need to use a if() with condition to show values for current quarter only and others to show 0. right?
Please try adding KEEPFILTERS to your measure.
Current Quarter Sales =
CALCULATE (
[Sales Amount],
KEEPFILTERS ( 'Calendar'[Current QTD] = 1 )
)
Pat
hi,
I think KEEPFILTERS() function only show related result, leaving every row value blank as expected, but I want the summation of JAN, Feb, March 2023 in one row, so it show like below:
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
87 | |
75 | |
74 | |
56 | |
45 |
User | Count |
---|---|
117 | |
105 | |
77 | |
66 | |
64 |