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.
I have the following measure:
Ind_Sold = VAR StoreSelec = DISTINCT('Aux_Store'[Store]) RETURN IF( ISEMPTY( EXCEPT( StoreSelec ; CALCULATETABLE(VALUES(Sales[Store]); Sales[Ind_Sold] = "Never") ) ); "Never Sold"; "Sold" )
I use the previous measure to "say" if some product "Sold" or "Never Sold", if the product "Sold" at least 1 store, I consider it "Sold", if the product don't sold on all stores, I consider it "Never Sold".
The measure is working so far, the problem is:
I have 3 stores, but the product only exists in 2 stores (and didn't sold on this 2 stores), then, the except is 1, then, the measure returns "Sold", but is incorrect, because it didn't sell on his 2 stores.
But the except is 1, not because of sold, because the product don't exist in the store, I need to adapt the measure to verify the product in only existing stores, is it possible?
Example of table Aux_Store:
Store |
Shopping |
Market |
Street |
Example of table Sale:
Product | Store | Ind_Sold |
F10 | Shopping | Yes |
F10 | Market | Never |
F10 | Street | Never |
F20 | Shopping | Never |
F20 | Market | Never |
F30 | Shopping | Yes |
F30 | Market | Yes |
F30 | Street | Never |
My problem is with product F20, it don't sold on Shopping and Market, but the except with table Store is 1, because of quantity.
For product F10 the return should be "Sold" and for F30 should be "Sold" too, because they sold in at least 1 store, but F20 should be "Never Sold".
Solved! Go to Solution.
hi, @gluizqueiroz
You may this simple measure to get your requirement:
Measure 3 = IF ( CALCULATE ( COUNTA ( Sales[Product] ), Sales[Ind_Sold] = "Yes" ) > 0, "Sold", "Never Sold" )
Best Regards,
Lin
hi, @gluizqueiroz
You may this simple measure to get your requirement:
Measure 3 = IF ( CALCULATE ( COUNTA ( Sales[Product] ), Sales[Ind_Sold] = "Yes" ) > 0, "Sold", "Never Sold" )
Best Regards,
Lin
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 |
---|---|
111 | |
100 | |
80 | |
64 | |
57 |
User | Count |
---|---|
146 | |
110 | |
93 | |
84 | |
67 |