The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Hi
I am trying to do a if statement.
IF CURRENT(YYYY-MM) = CurrentYearMonth THEN M1
And I want to put that date in a card.
How can I do this.
Solved! Go to Solution.
I did it by creating a column, but I wish i didnt have to create one.
Created a new column:
Hi @samnaw ,
Based on the sample and description you provided,
You can also consider the following code to create a Measure.
Measure =
MAXX(
FILTER('insertDatePLCS',[CurrentYearMonth]=FORMAT(TODAY(), "YYYY-MM")),
'insertDatePLCS'[M0]
)
Result is as below.
Is this the result you expect?
Please correct me if I misunderstood your needs.
Best Regards,
Yulia Yan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
I did it by creating a column, but I wish i didnt have to create one.
Created a new column:
No, I want to insert a card that gives me the date associated with currentYearMonth. With no filters selected.
I am still getting the wrong result:
I should be getting "2024-01-01" but I am getting "NULL"
can you upload a power bi sample file with the page that you are trying to create?
i assume you want to compare what's selected on a slicer with the current yearMonth right ?? if so then just create a new measure
MeasureX = IF ( FORMAT ( TODAY(), "yyyy-MM" ) = SELECTEDVALUE( 'YOUR_TABLE_NAME'[CurrentYearMonth]), "A","B")
IF This helps, just mark it down as a solution, thanks 🙂
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the August 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
113 | |
80 | |
80 | |
47 | |
40 |
User | Count |
---|---|
152 | |
110 | |
64 | |
64 | |
57 |