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.
Hello,
Currently I am using direct SQLto upload data into Power BI. As you all know, direct SQL disables many of Power BI's functionalities such as creating conditional columns among others. How may I create an if statement in Power BI using the measurement feature to compare two dates? Basically I have a PO Date and an Invoice date. I would like the measure to count the number of instances the invoice date is prior to the PO date.
Any help would be much appreciated.
Regards,
Gus Dahu
Solved! Go to Solution.
Hi @gusdahu,
Please try below measures:
check = IF(MAX(Table1[Invoice date])<MAX(Table1[PO Date]),1,0) count = CALCULATE(COUNTROWS(Table1),FILTER(Table1,[check]=1 ))
Best regards,
Yuliana Gu
Hi @gusdahu,
Please try below measures:
check = IF(MAX(Table1[Invoice date])<MAX(Table1[PO Date]),1,0) count = CALCULATE(COUNTROWS(Table1),FILTER(Table1,[check]=1 ))
Best regards,
Yuliana Gu
Hi Yuliana,
Thank you for your response!
After I type in the formula into my measurement, should the table automatically populate with a new column for the measurement? I attempted to manually add the measurement to the table, however I get the rejection "Can't display visual. See details". I have no idea what I am doing wrong.
Regards,
Gus Dahu
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 |
---|---|
109 | |
98 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
100 | |
86 | |
64 |