Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hello All:
I have a table that reads like this
Year | Max | MaxPeriod | Min | MinPeriod |
2018 | 234.52 | June 2018 | 112.34 | October 2018 |
2019 | 573.34 | September 2019 | 352.35 | June 2019 |
I've written a switch statement that works perfectly to give me the Min and Min and Max, but for a seperate card, how can I get write another Switch to return the associated Period fields?
I can't seem to figure out any DAX functions that will allow me to return a field that is a text format... and all the youtube examples show people typing a static string in quotes
Please let me know if this is not clear enough.
Thank You!
@Anonymous
Ok, guys. Thanks for the help, but it looks like I made a silly mistake and got it to work when i fixed it.
I was only fixing the first set of criteria in my switch statement, but had errors later on in the formula that I (very wrongly) assumed would not affect the result as long as i didn't select the values in my SELECTEDVALUES portion of my expression. Turns out, the entire measure doesn't work if a single part of it has an error...
Sorry for the runaround and thanks for replying
Hi @Anonymous ,
If your problem has been solved, please consider Accept it as the solution to help the other members find it more quickly.
Best regards,
Lionel Chen
Hi @Anonymous ,
For the usage of the DAX functions, you can refer to the following official documents:
https://docs.microsoft.com/en-us/dax/switch-function-dax
Best regards,
Lionel Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
Not quite sure what you want to return. In DAX, all strings need to be double quoted.
Measure 4 =
SWITCH(
TRUE(),
MAX('Sales 2015'[Month]) = "January", "JAN",
"ss"
)
Maybe you can give me a sample data and tell me what you want to return, I will try to write the DAX formula.
Best regards,
Lionel Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Not very clear. But let say if you get max date
Period = format(max(date[date]),"MMMM-YYYY")
Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution.
In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blogs -Decoding Direct Query - Time Intelligence, Winner Coloring on MAP, HR Analytics, Power BI Working with Non-Standard TimeAnd Comparing Data Across Date Ranges
Connect on Linkedin
User | Count |
---|---|
125 | |
106 | |
99 | |
63 | |
62 |
User | Count |
---|---|
135 | |
116 | |
101 | |
71 | |
61 |