Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi Community,
I am facing a problem in creating a dax formula.
so i have one column with stages. With that column i want to create another column where i will get 2 option.
Option 1 is "Total"
Option 2 is "Stage 2"
total is basically adding of all stages whereas second stage is only stage 2.
Can it be possible with DAX? if yes please help me with the dax or give another solution.
Thanks,
Yashashri
Solved! Go to Solution.
Hi @YASHASHRI ,
You could create a table with "TOTAL" and "STAGE 2" by entering data.
Then use the SWITCH function to filter.
Measure = SWITCH(SELECTEDVALUE('Table (2)'[SLICER]),"TOTAL",SUMX(ALL('Table'),[STAGES]),"STAGE 2","STAGE 2")
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @YASHASHRI ,
You could create a table with "TOTAL" and "STAGE 2" by entering data.
Then use the SWITCH function to filter.
Measure = SWITCH(SELECTEDVALUE('Table (2)'[SLICER]),"TOTAL",SUMX(ALL('Table'),[STAGES]),"STAGE 2","STAGE 2")
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
The sum of all stages is:
Total = CALCULATE(SUM(Table1[Stage]), Table1[Stage])
To get the sum of only Stage 2, you can use the IF statement:
Total = CALCULATE(SUM(Table1[Stage]), IF(Table1[Stage] = "Stage 2", 1, 0))
Not giving me the result.
@YASHASHRI
Can you please provide a screenshot of the results and include the dax code that you have used?
Hi @YASHASHRI
Slicer table is a disconnected table inserted manually that has two values ("TOTAL", "STAGE @2")
Then to sum a column for example you can use the following DAX
Value =
IF (
SELECTEDVALUE ( SlicerTable[Option] ) = "STAGE2",
CALCULATE ( SUM ( 'Table'[Column] ), 'Table'[Stage] = 2 ),
SUM ( 'Table'[Column] )
)
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
47 | |
26 | |
19 | |
14 | |
10 |
User | Count |
---|---|
57 | |
49 | |
44 | |
18 | |
18 |