Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Hi All!
i have this Dax:
My problem is, the formula only works when i filter Amazon
I want it to work whenever source = Amazon
Just need to replace SELECTEDVALUE right?
Please Help
Solved! Go to Solution.
Like Samarth said you should get the column as a suggestion. Are you using a measure now? If so you here is a completely new approach to this:
Proud to be a Super User!
Hi again 😁,
When using selectedvalue in a measure like in your example the logic is applied in the filter context. E.g. here only customer A's Dates are shown as blank:
(edit: I forgot to add my example. Here the source column -> in this case customer, is not acting as a filter. @netanel 😞
If you want to remove the filter context you can use functions like ALL or REMOVEFILTERS. Based on your example the measure should work? What am I missing here?
Edit 2:
Here is an example on how to do this kind of logic in a column:
Proud to be a Super User!
@netanel
So now that I know it is a column a simple IF logic should be fine. As you can see in my example above, if you are creating a calculated column there is no need for MAX/SELECTEDVALUE. e.g.
Proud to be a Super User!
Hi @ValtteriN
Thanks I think it's really close ...
@netanel just remove source from this line 'db 2021'[Source] = "Amazon", and click on ctrl+space bar it will suggest column names then select source column from there. It will work.
Best Regards,
Samarth
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin
It only offers me formula...
And I do not understand why
Like Samarth said you should get the column as a suggestion. Are you using a measure now? If so you here is a completely new approach to this:
Proud to be a Super User!
Thank you!
It works great
Thanks for the time i really appreciate it!
😊
Hi again 😉 @ValtteriN
You're right,
But I do not use a source column as a filter
I just want that every time that Source = to Amazon
Then connect the Fee column to the Gross column
Hi @netanel ,
You can try below code:-
Gross USD =
IF (
MAX( 'db 2021'[Source]) = "Amazon",
CALCULATE (
DIVIDE (
( SUM ( 'DB 2021'[Gross USD] ) + SUM ( 'DB 2021'[Fee USD] ) ),
COUNTROWS ( 'Date' )
),
KEEPFILTERS ( 'Date'[Date] < TODAY () )
),
CALCULATE (
DIVIDE ( SUM ( 'DB 2021'[Gross USD] ), COUNTROWS ( 'Date' ) ),
KEEPFILTERS ( 'Date'[Date] < TODAY () )))
Thanks,
Samarth
Best Regards,
Samarth
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin
HI @Samarth_18
MAX Brings me the same results...
Just to clarify is the DAX you use a measure or a column?
Proud to be a Super User!
Sorry friends,
I was thinking in the wrong direction and a bit complicated it.
I went backwards and the direction of @ValtteriN is the right direction
The Gross formula works well so I'll just add the Fee to it whit +
The problem is I only need the Fee when the Source is "Amazon"
So that's what I've put together
The second formula gets Blank
Why?
1.
Hi @ValtteriN
a Column
Thanks for your time!
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
21 | |
15 | |
14 | |
11 | |
7 |
User | Count |
---|---|
25 | |
24 | |
12 | |
12 | |
11 |