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.
I just wanted to know whether using CALCULATE and DAX, can we create a measure such that a specific column value is ignored.
I have a table called 'Environment Name' and "Quantitiy'.
Environment Table contains names as 'Air','Water' and 'Land'.
I want to create 3 measures each for Air, Water and Land such that the first measure(Air) can have just the values from Water and Land and vice versa.
I have tried doing the same using two DAX queries, but I am not getting a s atisfactory solution.
2 ways which I used to write the query is given below;
1)No Air = CALCULATE(SUM(Purchase[Quantity]),VALUES(Environment[EnvironmentName])<>"Air")
Solved! Go to Solution.
@SanketBhagwat , Try like
CALCULATE(SUM(Purchase[Quantity]),filter(Environment, Environment[EnvironmentName]<>"Air"))
assuming slicer is no filtering the value
else
CALCULATE(SUM(Purchase[Quantity]),filter(all(Environment), Environment[EnvironmentName]<>"Air"))
or
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.
if needed check
Need of an Independent Table in Power BI: https://youtu.be/lOEW-YUrAbE
@SanketBhagwat , Try like
CALCULATE(SUM(Purchase[Quantity]),filter(Environment, Environment[EnvironmentName]<>"Air"))
assuming slicer is no filtering the value
else
CALCULATE(SUM(Purchase[Quantity]),filter(all(Environment), Environment[EnvironmentName]<>"Air"))
or
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.
if needed check
Need of an Independent Table in Power BI: https://youtu.be/lOEW-YUrAbE
Hi Amit.
The query
'CALCULATE(SUM(Purchase[Quantity]),filter(Environment, Environment[EnvironmentName]<>"Air"))' worked perfectly fine.
Thanks for the help!
Regards,
Sanket Bhagwat
User | Count |
---|---|
28 | |
12 | |
8 | |
7 | |
5 |
User | Count |
---|---|
35 | |
14 | |
12 | |
9 | |
7 |