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.
Hi,
Need help with the dax query:
Selection in report :
I need to calucate the value until the Year and Month Name selected in the filter panel. (i.e <=)
Trying the dax :
Solved! Go to Solution.
Hi @ashmitp869 ,
Please try the following methods and check if they can solve your problem:
1.Create the sample Table.
2.Drag the year, month and Service Group into the three slicer visuals.
3.Create the new measure to calculate filtered Date.
SUM_selected =
VAR sm_sel = SELECTEDVALUE(SM[Service Group Level 0])
var total_sel = CALCULATE (
SUM ('Table'[Revenue]),
FILTER (
ALL ('Table'),
'Table'[Year] < SELECTEDVALUE('Table'[Year]) || ('Table'[Year] = SELECTEDVALUE('Table'[Year]))
&& 'Table'[Month] <= SELECTEDVALUE('Table'[Month])
)
)
RETURN
IF(sm_sel = "Revenue", total_sel ,BLANK())
4.Drag the measure into the card visual.
5.Select the Year and month in the slicer visual. The result is shown below.
Best Regards,
Wisdom Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @ashmitp869 ,
Please try the following methods and check if they can solve your problem:
1.Create the sample Table.
2.Drag the year, month and Service Group into the three slicer visuals.
3.Create the new measure to calculate filtered Date.
SUM_selected =
VAR sm_sel = SELECTEDVALUE(SM[Service Group Level 0])
var total_sel = CALCULATE (
SUM ('Table'[Revenue]),
FILTER (
ALL ('Table'),
'Table'[Year] < SELECTEDVALUE('Table'[Year]) || ('Table'[Year] = SELECTEDVALUE('Table'[Year]))
&& 'Table'[Month] <= SELECTEDVALUE('Table'[Month])
)
)
RETURN
IF(sm_sel = "Revenue", total_sel ,BLANK())
4.Drag the measure into the card visual.
5.Select the Year and month in the slicer visual. The result is shown below.
Best Regards,
Wisdom Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
User | Count |
---|---|
25 | |
10 | |
8 | |
6 | |
5 |
User | Count |
---|---|
31 | |
11 | |
10 | |
10 | |
9 |