The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
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:
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the August 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
78 | |
66 | |
52 | |
50 |
User | Count |
---|---|
121 | |
120 | |
78 | |
63 | |
62 |